2、解压缩并且进入解压缩后的文件目录下
3、./configure --prefix=/data/apps/php --with-config-file-path=/data/apps/php/etc --with-apxs2=/data/apps/apache/bin/apxs --disable-ipv6 --with-curl --with-gd --with-mysql=/data/apps/mysql --with-mysqli=/data/apps/mysql/bin/mysql_config --with-pdo-mysql=/data/apps/mysql --enable-soap --enable-sockets --with-pear=/data/apps/php/pear --with-png-dir --with-libxml-dir --with-jpeg-dir --enable-mbstring --enable-zip --with-zlib --enable-gd-native-ttf --with-freetype-dir=/usr --with-openssl
4、make;make install
遇到问题:
1、configure: error: xml2-config not found. Please check your libxml2 installation(参看:http://blog.csdn.net/anljf/article/details/6981247)
安装php时的报错
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
检查是否安装了libxm包
[root@XKWB3403 php-5.3.8]# rpm -qa |grep libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12
重新安装libxml2和libxml2-devel包
yum install libxml2
yum install libxml2-devel -y
安装完之后查找xml2-config文件是否存在
[root@XKWB3403 php-5.3.8]# find / -name "xml2-config"
/usr/bin/xml2-config
如果存在的话重新安装php
[root@XKWB3403 php-5.3.8]# ./configure
安装成功的标志是
之后再进行编译
make && make install
2、configure: error: Cannot find OpenSSL's
解决办法:yum install openssl.x86_64 openssl-devel.x86_64 -y
3、configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/
解决办法:yum install libcurl.x86_64 libcurl-devel.x86_64 -y
4、configure: error: libjpeg.(a|so) not found.
解决办法:yum install libjpeg-devel -y; ln -s /usr/lib64/libpng.so /usr/lib/
configure: error: libpng.(a|so) not found.
解决办法:yum install libpng libpng-devel -y; ln -s /usr/lib64/libpng.so /usr/lib/configure: error: freetype.h not found.
解决办法:yum install freetype-devel