发新话题
打印

自己的编译php源码的参数(LINUX+PHP4.4.6)

自己的编译php源码的参数(LINUX+PHP4.4.6)

Linux有一个SELinux保护模式引起的,还有装vsftpd时也要注意,出现异常错误时要先看看SElinux,昨天搞得我郁闷一天!
关闭SELINUX的方法:

vi /etc/selinux/config
将SELINUX=enforcing 改成SELINUX=disabled
保存,重起电脑即可.

php4.4.6+apache2.2.4+zlib-1.2.3+libpng-1.2.8+jpegsrc.v6b+gd-2.0.26+ZendOptimizer+freetype2.1.10

先安装的apache, 这个比较简单:
复制内容到剪贴板
代码:
./configure --enable-so && make && make install
这部分是PHP的(参数太多了,记下来日后再用,呵呵)
CURL库:
http://www.execve.net/curl/

1. 安装zlib
复制内容到剪贴板
代码:
./configure && make && make install
2. 安装jpegsrc
复制内容到剪贴板
代码:
./configure && make && mkdir -p /usr/local/man/man1 && make install-lib && make install
3. 安装libpng
复制内容到剪贴板
代码:
cp scripts/makefile.linux Makefile && make && make install-headers && make install
4. 安装freetype
复制内容到剪贴板
代码:
./configure && make && make install
5. 安装gd
复制内容到剪贴板
代码:
./configure --with-jpeg=/usr/local --with-png=/usr/local --with-freetype=/usr && make && make install
编译PHP:
复制内容到剪贴板
代码:
'./configure --prefix=/mail/httpd/php --with-apache2=/mail/httpd --with-apxs2=/mail/httpd/bin/apxs --with-mysql=/usr/local/mysql --enable-ftp --enable-zip --enable-ldap --enable-exif --enable-mbstring --enable-mbregex --enable-calendar --enable-curl --disable-debug --enable-inline-optimization --with-jpeg-dir=/usr/local --with-png --enable-thread-safety --enable-ctype --with-bz --with-zlib --with-gd --with-kerberos --with-gettext --enable-force-cgi-redirect --enable-sockets --with-ttf --with-freetype-dir=/usr/local/lib --enable-gd-native-ttf --with-curl=/usr/local/curl --with-iconv
make && make install
cp php.ini-dist /usr/local/lib/php.ini
编辑apache的httpd.conf
添加
复制内容到剪贴板
代码:
AddType application/x-httpd-php .php
启动apache:
复制内容到剪贴板
代码:
/usr/local/apache2/bin/apachectl start
安装ZendOptimizer
复制内容到剪贴板
代码:
./install.sh
昨天遇到了这个问题,在网上狂搜索一番终于解决了,贴出来一下留个底:
引用:
File `NONEXISTENT/charsets/?.conf` not found (Errcode: 2)
File `/usr/share/mysql/charsets/?.conf` not found (Errcode: 2)
Character set `#33` is not a compiled character set and is not specified in the `/usr/share/mysql/charsets/Index` file
解决方法:
先确认phpinfo()里的mysql版本,假如版本和您和正在运行的MYSQL版本不一样就是有问题了,以本站的例子:本站升级到5.1.3,可是phpinfo()看到的却是3.23.49,必需重新compile PHP一次:
./configure加入--with-mysql=指定mysql正确位置
之后确认phpinfo()里的mysql版本。

WEB服务器:
引用:
./configure --prefix=/mail/httpd/php --with-apache2=/mail/httpd --with-apxs2=/mail/httpd/bin/apxs --with-mysql=/usr/local/mysql --enable-ftp --enable-zip --enable-ldap --enable-exif --enable-mbstring --enable-mbregex --enable-calendar --enable-curl --disable-debug --enable-inline-optimization --with-jpeg-dir=/usr/local --with-png --enable-thread-safety --enable-ctype --with-bz --with-zlib --with-gd --with-kerberos --with-gettext --enable-force-cgi-redirect --enable-sockets --with-ttf --with-freetype-dir=/usr/local/lib --enable-gd-native-ttf --with-curl=/usr/local/curl

TOP

发新话题