
在Linux系统 phpsoft文件夹下
解压 php-5.6.28.tar.gz
tar zxvf php-5.6.28.tar.gz
cd php-5.6.28
运行安装命令
./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysqli --with-pdo-mysql --enable-mbstring
如果出现如下错误

说明需要安装
libxml2-devel 依赖包
从系统光驱里拷贝
安装时提示错误 还是缺少依赖库

继续从添加依赖


安装完之后查找xml2-config文件是否存在
[root@XKWB3403 php-5.3.8]# find / -name "xml2-config"
/usr/bin/xml2-config
再次执行
[root@localhost php-7.0.12]# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysqli --with-pdo-mysql --enable-mbstring
出现下面说明安装成功

配置Apache能够解析PHP代码
在Apache的配置文件中
修改权限chmod -R 777 ./* /usr/local/apache
cd /usr/local/apache/conf/httpd.conf
新增下面配置

然后

然后添加下图中的黄色字体

在终端的php-7.0.12文件中执行make, make install

通常情况下会自动在Apache下生成

如果没有可以到下面路径中拷贝

然后再次重启apache
网友评论