没想到编译个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./ext/iconv/iconv.c:: more undefined references to `libiconv'
缺少libiconv,真奇怪,不是有么。
去安装libiconv就行了
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz
wget http://www2d.biglobe.ne.jp/~msyk/software/libiconv/libiconv-1.13-ja-1.patch.gz
tar zxvf libiconv-1.13.tar.gz
cd ./libiconv-1.13.tar.gz
gzip -dc ../libiconv-1.13-ja-.patch.gz | patch -p1
make
make install ln -s /usr/local/lib/libiconv.so.2.5. /usr/local/lib64/libiconv.so
ln -s /usr/local/lib/libiconv.so.2.5. /usr/local/lib64/libiconv.so.
依次执行后用下面的这个参数配置安装信息:
./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql --prefix=/usr/local/php5.6 --with-iconv=shared,/usr/local
就可以了,记得make之前,要 make clean
参考文章:http://d.zeromemory.info/2014/03/01/php5-4-25-build-error-iconv.html
后来我加了一些常用的参数(选项分先后)
./configure --with-apxs2=/usr/local/httpd/bin/apxs --prefix=/usr/local/php5.6 --with-iconv=shared,/usr/local --enable-bcmath --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 --enable-opcache --with-pear --enable-soap --enable-sockets --enable-wddx --with-xsl --enable-zip --with-zlib --with-bz2 --with-openssl --enable-cgi --enable-fpm
编译apache2的module,以rewrite_mod举例:
到/usr/src/httpd-2.2/modules/mappers
然后执行 /usr/local/apache2/bin/apxs -c -i mod_rewrite.c
再添加 LoadModule rewrite_module modules/mod_rewrite.so 到对应的位置
引用:
编译mod来自:http://forum.ivorde.ro/apache-2-2-installation-of-mod-rewrite-module-without-recompiling-whole-apache-t67.html