CentOS-6.8下编译安装php-5.6.23

老虎说测试 脚本开发字数 1247阅读4分9秒阅读模式
摘要CentOS-6.8下编译安装php-5.6.23

CentOS-6.8下编译安装php-5.6.23。

下载文件

进入到我们的软件下载位置,并下载文件文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

 文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

cd soft/文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

wget http://cn2.php.net/distributions/php-5.6.23.tar.gz文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

 文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

安装php-5.6.23

 文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

解压文件并进入到解压后的文件夹文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

 文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

tar xzf php-5.6.23.tar.gz && cd php-5.6.23文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

 文章源自陈学虎-https://chenxuehu.com/article/2016/06/5416.html

./configure检测

 

./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php/etc   --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/

 

报错了

 

Sorry, I cannot run apxs. Possible reasons follow:

1. Perl is not installed

2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs

3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /usr/local/apache/bin/apxs follows:

./configure: /usr/local/apache/bin/apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory

configure: error: Aborting

 

直接安装解决错误再说,这个错误一般容易错误的解决,正确的解决方式是

 

vi  /usr/local/apache/bin/apxs

#!/replace/with/path/to/perl/interpreter -w

改为

#!/usr/bin/perl -w

 

继续检测,发现还有错误

 

configure: error: xml2-config not found. Please check your libxml2 installation.

 

直接安装即可

 

yum install libxml2 libxml2-devel -y

 

安装后再次检测,如果不出意外,就应该成功了,如果还有错误,继续解决即可:

 

CentOS-6.8下编译安装php-5.6.23-图片1

 

 

接下来就简单了

 

make && make install

 

喝杯咖啡去...

CentOS-6.8下编译安装php-5.6.23-图片2

 

喝完咖啡,也安装完成了,我们配置下去:

vi /usr/local/apache/conf/httpd.conf

oadModule     php5_module modules/libphp5.so (默认已存在)

AddType application/x-httpd-php .php

DirectoryIndex  index.php index.html (把index.php加入index.html之前)

 

 

 

 

 最后更新:2022-3-4
  • 版权声明:本文为原创文章,转载请附上原文出处链接及本声明。
  • 转载请注明:CentOS-6.8下编译安装php-5.6.23 | https://chenxuehu.com/article/2016/06/5416.html
  • php-5.6.23
评论  3  访客  3