rhelas3安装php5遇到的一系列问题

安装php5遇到的问题:
./configure后出现
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
configure: error: libxml2 version 2.6.11 or greater required.
 
说明libxml2版本比较低
用apt-get install libxml2
apt-get install libxml2-level 更新包后还是不行
 
搜索后发现问题可能是:
[root@heavyrain bin]# ls  -l  /usr/lib/libxml2.*
-rw-r--r--    1 root     root      1132232 Feb 29  2004 /usr/lib/libxml2.a
-rwxr-xr-x    1 root     root          708 Feb 29  2004 /usr/lib/libxml2.la
lrwxrwxrwx    1 root     root           16 Mar 19 22:22 /usr/lib/libxml2.so -> l
ibxml2.so.2.5.4
lrwxrwxrwx    1 root     root           16 Mar 19 21:54 /usr/lib/libxml2.so.2 ->
 libxml2.so.2.5.4
-rwxr-xr-x    1 root     root       954820 Feb 29  2004 /usr/lib/libxml2.so.2.5.4
链接有问题?

下载更新libxml
rpm -Uvh libxml2-2.6.23-1.2.i386.rpm --nodeps
rpm -Uvh libxml2-devel-2.6.23-1.2.i386.rpm --nodeps

再次./configure
报错误变为:

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... no
configure: error: build test failed.  Please check the config.log for details.

怀疑是路径问题,但是还没解决
./configure --prefix=/usr/local/php -with-mysql=/var/lib/mysql --with-libxml-dir=/usr/lib/include/libxml2/libxml

反复安装几次都不行,决定重新编译安装libxml
下载并安装libxml2-sources-2.6.23.tar.gz

根据libxml新安装路径-with-xml2-config=/usr/local/lib进行配置:

./configure --prefix=/usr/local/php -with-mysql=/var/lib/mysql -with-xml2-config=/usr/local/lib

原来的错误没有出现,但报了新错误:
configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.

重新安装 zlib-1.2.3.tar.gz
确定相关软件目录:

./configure --prefix=/usr/local/php --with-mysql-dir=/home/heavyrain/mysql-max-3.23.58-pc-linux-i686  --with-xml2-config=/usr/local/lib --with-zlib-dir=/usr/local/zlib2/
 

终于成功了!

| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.


make时出现
ext/standard/basic_functions.o(.data+0xe38): In function `zif_getenv':
/home/liuzhen/php-5.1.2RC2/ext/standard/basic_functions.c:1413: undefined reference to `zif_log1p'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1



make install

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值