几种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