今天在64位Red Hat Enterprise Linux AS release 4 .7上编译PHP5.2.6出错,MysqL是使用的RPM方式安装的,PHP编译代码如下:
PHP --with-MysqL --with-apxs2=/usr/local/apache/bin/apxs --with-openssl --with-curl --enable-xml --with-mcrypt --with-ttf --enable-magic-quotes --enable-fastcgi --enable-mbstring --with-iconv --enable-mbstring --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-sysvsem出现以下错误:checking for specified location of the MysqL UNIX socket... no
checking for MysqL UNIX socket location... no
configure: error: Cannot find libMysqLclient under /usr.
Note that the MysqL client library is not bundled anymore!
通过查找libMysqLclient,发现是在/usr/lib64/MysqL/目录内的libMysqLclient.so.16.0.0做的软连接,PHP默认是去的 /usr/lib/搜索,所以没有找到.找到问题了就好解决了.
类似的问题还有:
/usr/lib64/libjpeg.so
@R_403_323@:
1.
2.
libMysqLclient.so.16.0.0/usr/lib/libMysqLclient.so -> /usr/lib64/libMysqLclient.so
checking whether to enable embedded MysqLi support… no
checking for MysqL_set_server_option in -lMysqLclient… no
configure: error: wrong MysqL library version or lib not found. Check config.log for more information
经过测试后,发现如下解决方案:
PHP-xxxxx/ext/MysqLi
# yum -y install MysqL-devel
# /PHPize
# ./configure –with-PHP-config= /PHP-config –enable-embedded-MysqLi=shared –enable-shared
# make
# make install
这时屏幕会打印MysqLi.so生成的路径,在PHP.ini里加载就好啦
MysqLclient
原文链接:https://www.f2er.com/php/24304.html