首页 > 代码库 > 编译php5.6
编译php5.6
没想到编译个LAMP这么麻烦又简单。
按照官网的做就可以了,只是我在CentOs下一直会提示出现这个错误
按照官网的安装方法:install
用下面的参数:
./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql --prefix=/usr/local/php5.6 --with-iconv-dir=/usr/local/lib
总是提示下面这个错误:
/php-5.6.0/ext/iconv/iconv.c:2512: more undefined references to `libiconv‘
缺少libiconv,真奇怪,不是有么。
去安装libiconv就行了
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gzwget http://www2d.biglobe.ne.jp/~msyk/software/libiconv/libiconv-1.13-ja-1.patch.gztar zxvf libiconv-1.13.tar.gzcd ./libiconv-1.13.tar.gzgzip -dc ../libiconv-1.13-ja-1.patch.gz | patch -p1makemake installln -s /usr/local/lib/libiconv.so.2.5.0 /usr/local/lib64/libiconv.soln -s /usr/local/lib/libiconv.so.2.5.0 /usr/local/lib64/libiconv.so.2
依次执行后用下面的这个参数配置安装信息:
./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql --prefix=/usr/local/php5.6 --with-iconv=shared,/usr/local
就可以了,记得make之前,要 make clean
后来我加了一些常用的参数(选项分先后)
./configure --with-apxs2=/usr/local/httpd/bin/apxs --prefix=/usr/local/php5.6 --with-iconv=shared,/usr/local --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-dba --enable-exif --enable-ftp --enable-inline-optimization --with-kerberos --enable-mbregex --enable-mbstring --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-mysql-sock=/var/lib/mysql/mysql.sock --with-pdo-mysql --with-pear --enable-soap --enable-sockets --enable-wddx --with-xsl --enable-zip --with-zlib
编译php5.6