centos 开放php 报错,几种centos下php安装报错原因分析与解决

本文详细分析了在CentOS 5.5上安装PHP 5.4.3时可能出现的配置错误,如libxml2、BZip2和MySQL相关的问题。解决方法包括检查并安装缺失的依赖包libxml2和libxml2-devel,以及bzip2和bzip2-devel。对于MySQL配置错误,需要确保指定的路径正确。通过执行相应的yum安装命令和查找相关配置文件,可以解决这些问题。
摘要由CSDN通过智能技术生成

几种centos下php安装报错原因分析与解决

问题描述:

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

sendos 5.5 安装 PHP 5.4.3 报 configure error xml2-config not found. please check your libxml2 installation 错误

检查是否安装了libxm包

原因分析:

缺少libxm包,需要安装PHP的依赖包。

解决方案

[root@rh-linux software]# rpm -qa |grep libxml2

libxml2-2.6.26-2.1.12

libxml2-python-2.6.26-2.1.12

重新安装libxml2和libxml2-devel包, yum安装的时候发现新版本会提示更新,需要更新的可以更新,不要跳过就行了。

# yum install libxml2

# yum install libxml2-devel -y

安装完之后查找xml2-config文件是否存在

# find / -name "xml2-config"

/usr/bin/xml2-config

问题描述:

Configure: error: Please reinstall the BZip2 distribution

解决方法如下:

#yum install bzip2

#yum install bzip2-devel -y

问题描述:

configure: error: Unable to find your mysql installation

我打的命令是:

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-pdo-mysql=/var/lib/mysql/mysql.sock --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --enable-soap --enable-gd-native-ttf --enable-ftp --enable-sockets --enable-mbstring --enable-exif --enable-memcache --disable-ipv6 --disable-cli

因为我写的mysql位置的路径发生错误,和实际工作路径不符.

# which mysql

/usr/bin/mysql

mysql的路径与实际工作路径替换添加命令: --with-mysql-dir=/usr/bin/mysql

问题描述:

checking for mysql_close in -lmysqlclient... no

checking for mysql_error in -lmysqlclient... no

configure: error: mysql configure failed. Please check config.log for more information.

解决问题:

如果是自己选择GZ包安装的MYSQL。这里要加路径。

加的方法为--with-mysql-dir=/user/local/mysql

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值