linux安装php5出现错误:configure: error: Cannot find libmysqlclient under /usr.
最近在centOs上安装apache+mysql+php5.1.6时,出现如下问题:configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
纠缠了我一天的时间,最后实在不行。还是百度。
得到一篇博文指导,成功解决了问题:原文网址:http://apps.hi.baidu.com/share/detail/15155324
内容如下:
php:
http://www.rpmfind.net/linux/rpm2html/search.php?query=php (rpm)
http://cn.php.net/get/php-5.3.0.tar.gz/from/a/mirror
./configure --help | grep mysql
tar -zxvf php-5.3.0.tar.gz
mv php-5.3.0.tar.gz php
cd php
rpm -Uvh MySQL-devel-standard-5.0.27-0.rhel4.x86_64.rpm
cp /usr/lib64/mysql/* /usr/lib/mysql/ #解决
./configure --prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-config-file-path=/usr/local/lib --enable-track-vars --with-xml--with-mysql --with-zlib-dir=/usr/local
#./configure --prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-config-file-path=/usr/local/lib --enable-track-vars --with-xml--with-mysql=/usr/lib64/mysql --with-zlib-dir=/usr/local (不正确)
make
make install
./configure --prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-config-file-path=/usr/local/lib --enable-track-vars --with-xml--with-mysql=/usr/lib64/mysql --with-zlib-dir=/usr/local (ok)
今天在64位centos5.2系统上编译PHP526出错,mysql是使用的RPM方式安装的,PHP编译代码:
?
?
configure: error: Cannot find libmysqlclient under /usr
Posted by alex in Errors
I received the below error when compiling PHP to work as an externalapplication with the Litespeed API. When you do compile this it’scalled the PHP LSAPI module which is then used by Litespeed to processPHP.
PHP Build Error:
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
The issue was that I the MySQL server version was 64-bit and the phpcompile script was looking for 32-bit libraries. To see if your MySQLserver is 64-bit or 32-bit check the version by issuing the belowcommand and looking for a response also shown below.
?
MySQL Version:
[root@server php-5.2.8]# mysql version
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (x86_64) using readline 5.0
To resolve the issue add the below configuration options to your PHP configure script.
Options to Add:
with-mysql=/usr/bin/ with-libdir=lib64
So my PHP configure script after adding these options now looked like the below which resolve the compile error.
PHP Configure Script:
./configure prefix=/var/lsws/lsphp5 with-litespeed with-mysqliwith-mcrypt with-mysql=/usr/bin/ with-libdir=lib64 with-zlibwith-gd enable-shmop
enable-track-vars enable-sockets enable-sysvsem enable-sysvshm enable-magic-quotes enable-mbstring with-iconv