安装php时出错,编译安装php出现的错误

[root@www php-5.5.28] #./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml  --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt  --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2

1.  编译时报错:configure: error: xml2-config not found. Please check your libxml2 installation.

原因:未安装libxml2

解决办法:

[root@www php-5.5.28]# rpm -qa |grep  libxml2

libxml2-2.7.6-14.el6.i686

libxml2-python-2.7.6-14.el6.i686

接着安装libxml2.i686和libxml2-devel.i686

[root@www php-5.5.28]# yum list all | grep libxml2

libxml2.i686                            2.7.6-14.el6                     @anaconda-CentOS-201311271240.i386/6.5

libxml2-python.i686                     2.7.6-14.el6                     @anaconda-CentOS-201311271240.i386/6.5

libxml2.i686                            2.7.6-20.el6                     base

libxml2-devel.i686                      2.7.6-20.el6                     base

libxml2-python.i686                     2.7.6-20.el6                     base

libxml2-static.i686                     2.7.6-20.el6                     base

[root@www php-5.5.28]# yum install libxml2.i686 -y

[root@www php-5.5.28]# yum install libxml2-devel.i686  -y

2.  重新编译后报错:configure: error: Cannot find OpenSSL's

原因:没有安装SSl

解决办法:

[root@www php-5.5.28]# rpm -qa  | grep openssl

openssl-1.0.1e-15.el6.i686

[root@www php-5.5.28]# yum list all | grep openssl-devel

openssl-devel.i686                      1.0.1e-42.el6                    base

[root@www php-5.5.28]# yum install openssl-devel.i686 -y

3.  重新编译后报错:checking for BZip2 in default path... not found

configure: error: Please reinstall the BZip2 distribution

原因:没有安装bzip2和bzip2-devel

解决办法:安装bzip2-devel

[root@www php-5.5.28]# yum list all | grep bzip2

bzip2.i686                              1.0.5-7.el6_0                    @anaconda-CentOS-201311271240.i386/6.5

bzip2-devel.i686                        1.0.5-7.el6_0                    base

[root@www php-5.5.28]# yum install  bzip2-devel.i686 -y

4.  重新编译后报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt.

原因:没有安装libmcrypt即相关组件

解决办法:

a.不使用加密功能,将--with-mcrypt去掉;

b.使用加密功能,但是要安装libmcrypt,libmcrypt-devel和mhash,mhash-devel

[root@www PHP]# rpm -ivh libmcrypt-2.5.8-9.el6.i686.rpm

[root@www PHP]# rpm -ivh libmcrypt-devel-2.5.8-9.el6.i686.rpm

[root@www PHP]# rpm -ivh mhash-0.9.9.9-3.el6.i686.rpm

[root@www PHP]# rpm -ivh mhash-devel-0.9.9.9-3.el6.i686.rpm

直到此时我才编译成功;

下面补充一些我没有遇到的编译错误:

5.  configure: error: Please reinstall the libcurl distribution -

easy.h should be in /include/curl/

原因:curl和curl库文件没有安装

解决办法:

[root@www ~]# yum list all | grep libcurl

libcurl.i686                            7.19.7-37.el6_4                  @anaconda-CentOS-201311271240.i386/6.5

libcurl.i686                            7.19.7-46.el6                    base

libcurl-devel.i686                      7.19.7-46.el6                    base

[root@www ~]# yum install  libcurl.i686  libcurl-devel.i686  -y

6.  configure: error: jpeglib.h not found

原因:GD库没有安装

解决办法:

安装libjpeg  libpng  freetype  freetype-devel   libjpeg-devel   libpng-devel

[root@www ~]# yum install libjpeg.i686 libpng.i686 freetype.i686 libjpeg-devel.i686 libpng-devel.i686 freetype-devel.i686 -y

当没有安装相关包时,先检查自己已经装了哪些缺少哪些没有装,然后直接安装为装的可以节约时间;

当出现  Thank you for using PHP.  时就说明编译没问题了,然后就可以make && make install了;

阅读(236) | 评论(0) | 转发(0) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值