CentOS php - configure: error: Cannot find libmysqlclient under /usr.

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2024
Перейти к:навигация, поиск

Самые выгодные сервера‎


CentOS php - configure: error: Cannot find libmysqlclient under /usr.

Ошибка при компиляции php:

checking for mcrypt support... yes
checking for libmcrypt version... >= 2.5.6
checking for mcrypt_module_open in -lmcrypt... yes
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!


Проверяем где находятся библиотеки mysql:

# ldconfig -v |grep mysql
       libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
       libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
       libmysqlclient.so.15 -> libmysqlclient.so.15.0.0
       libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
       libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
# locate libmysqlclient.so.16
/usr/lib64/libmysqlclient.so.16
/usr/lib64/libmysqlclient.so.16.0.0
/usr/local/cpanel/3rdparty/lib64/mysql/libmysqlclient.so.16
/usr/local/cpanel/3rdparty/lib64/mysql/libmysqlclient.so.16.0.0


Решение - добавляем опцию --with-libdir=lib64:

# ./configure --prefix=/opt/php53 --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr  --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --disable-rpath  --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm  --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-libdir=lib64  --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --enable-ftp --with-imap-ssl --with-kerberos --with-gettext --enable-cgi