./configure --prefix=/usr/local/webserver/php
--with-config-file-path=/usr/local/webserver/php/etc
--with-mysql=/usr/local/webserver/mysql
--with-mysqli=/usr/local/webserver/mysql/bin/mysql_config
--with-iconv-dir=/usr/local
--with-freetype-dir
--with-jpeg-dir
--with-png-dir
--with-zlib
--with-libxml-dir=/usr
--enable-xml
--disable-rpath
--enable-safe-mode
--enable-bcmath
--enable-shmop
--enable-sysvsem
--enable-inline-optimization
--with-curl
--with-curlwrappers
--enable-mbregex
--enable-fpm
--enable-mbstring
--with-mcrypt
--with-gd
--enable-gd-native-ttf
--with-openssl
--with-mhash
--enable-pcntl
--enable-sockets
--with-ldap
--with-ldap-sasl
--with-xmlrpc
--enable-zip
--enable-soap
--without-pear
看到网上一大堆资料在编译php-5.3.8 都带
--enable-discard-path
--enable-fastcgi
--enable-force-cgi-redirect
其实php-5.3.8已经不再使用上述三个选项了。
make ZEND_EXTRA_LIBS='-liconv'
如果 make 报错:/data/soft/php-5.3.8/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.phar] 错误 127
如果你的是32位系统 运行下述命令:
ln -s /usr/local/webserver/mysql/lib/libmysqlclient.so.18 /usr/lib/
64位系统运行下述命令
ln -s /usr/local/webserver/mysql/lib/libmysqlclient.so.18 /usr/lib64/
注意:你的libmysqlclient.so.18 实际位置