因为mysql、apache、php都是yum安装,首先删除php
yum remove php*
刚开始编译php5.5.7,首先下载
wget http://cn2.php.net/distributions/php-5.5.7.tar.gz
tar -xvzf php-5.5.7.tar.gz到/wooface/php-5.5.7
yum -y install httpd-devel我的计算机是64位的,也可使用yum install httpd-devel.x86_64,这一步主要是装上apxs,如果没有apxs的话,编译php时就没办法生成libphp5.so文件了。也就没办法让apache来运行你的php代码
然后进入解压后的目录,
./configure --prefix=/wooface/php5.3.28/php-5.3.28 --with-apxs2=/usr/sbin/apxs \
--with-mysql=/usr/bin/mysql \
--with-pdo-mysql=/usr/bin/mysql \
--with-mysqli \
--with-gd \
--with-openssl \
--enable-gd-native-ttf \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib \
--with-gettext \
--with-curl \
--with-iconv \
--with-bz2 \
--with-mcrypt=/usr/local/libmcrypt \
--enable-soap \
--enable-sockets \
--enable-mbstring=all \
--enable-bcmath \
--enable-ftp
make
make install
即可
编译时候,系统自动往httpd.conf写入LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
记得重新启动http服务即可
service httpd restart
这个编译完成很奇怪,用phpinfo打印环境变量时候,死活都出现不了下图加框的东西
搞了好久,没弄出来,算了,后来想想,知道大概原因了,在多次编译时候,应该做make clean不然前次的编译可能影响下次编译
PHP5.5.75.3.28编译总结
评论