1、下载PHP
#wget http://cn2.php.net/distributions/php-5.6.37.tar.gz
2、解压
#tar -zvxf php-5.6.37.tar.gz
3、安装依赖软件
#yum install bzip2 bzip2-devel libxml2 libxml2-devel libpng libpng-devel libjpeg libjpeg-devel -y
4、预编译
#./configure -prefix=/usr/local/php5 -with-config-file-path=/usr/local/php5/etc -with-apxs2=/usr/local/apache/bin/apxs -with-mysql=/usr/local/mysql/
5、编译安装
#make && make install
6、整合Apache+PHP源码
vim httpd.conf
为了能让Apache识别PHP文件,vim httpd.conf编辑配置文件,加一下代码:
AddType application/x-httpd-php .php
DirectoryIndex index.html index.php index.htm
7、在/usr/local/apache/htdocs目录下创建index.php测试文件
#cd /usr/local/apache/htdocs
#vim index.php
加入以下内容:
<?php
phpinfo();
?>
8、浏览器访问:192.168.31.113或jack711(主机)
安装成功!!!