Home Backend Development PHP Tutorial Solution to the error configure error Cannot find libmysqlclient under usr when compiling PHP_PHP tutorial

Solution to the error configure error Cannot find libmysqlclient under usr when compiling PHP_PHP tutorial

Jul 13, 2016 am 10:26 AM
Report an error

An error occurred when compiling PHP5.2.6 on 64-bit Red Hat Enterprise Linux AS release 4.7 today. MySQL was installed using RPM. The PHP compilation code is as follows:

./configure --prefix=/usr/local/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!
Copy after login

By searching for libmysqlclient, I found that it was a soft connection made by libmysqlclient.so.16.0.0 in the /usr/lib64/mysql/ directory. PHP searches in /usr/lib/ by default, so it was not found. Found the problem It will be solved soon.

Similar questions include:

/usr/lib/libjpeg.so -> /usr/lib64/libjpeg.so
Copy after login

Solution:

1.

cp -rp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so
Copy after login

2.

/usr/lib64/libmysqlclient.so -> 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
Copy after login

After testing, the following solution was found:

(php-xxxxx is the php file name, representing the path)

# cd /usr/local/src/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
Copy after login

At this time, the screen will print the path generated by mysqli.so, just load it in php.ini

/usr/bin/ld: cannot find -lmysqlclient
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824756.htmlTechArticleAn error occurred when compiling PHP5.2.6 on 64-bit Red Hat Enterprise Linux AS release 4.7 today, mysql is used Installed in RPM mode, the PHP compilation code is as follows: ./configure --prefix=/usr/local/php --with-...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Column count doesn't match value count at row 1 - How to solve MySQL error: column number does not match value Column count doesn't match value count at row 1 - How to solve MySQL error: column number does not match value Oct 05, 2023 am 11:40 AM

Column count doesn't match value count at row 1 - How to solve MySQL error: column number does not match value

Incorrect table definition; there can be only one auto column and it must be defined as a key - How to solve MySQL error: Incorrect table definition; there can be only one auto column and it must be defined as a key Incorrect table definition; there can be only one auto column and it must be defined as a key - How to solve MySQL error: Incorrect table definition; there can be only one auto column and it must be defined as a key Oct 05, 2023 am 11:05 AM

Incorrect table definition; there can be only one auto column and it must be defined as a key - How to solve MySQL error: Incorrect table definition; there can be only one auto column and it must be defined as a key

mysql error 10060 mysql error 10060 Sep 12, 2023 am 11:00 AM

mysql error 10060

Cause analysis: HTTP request error 504 gateway timeout Cause analysis: HTTP request error 504 gateway timeout Feb 19, 2024 pm 05:12 PM

Cause analysis: HTTP request error 504 gateway timeout

Solution: Socket Error when handling HTTP requests Solution: Socket Error when handling HTTP requests Feb 25, 2024 pm 09:24 PM

Solution: Socket Error when handling HTTP requests

Unknown column 'column_name' in 'where clause' - How to solve MySQL error: unknown column in where clause Unknown column 'column_name' in 'where clause' - How to solve MySQL error: unknown column in where clause Oct 05, 2023 am 11:15 AM

Unknown column 'column_name' in 'where clause' - How to solve MySQL error: unknown column in where clause

Step-by-step guide to quickly solve pyqt5 installation errors Step-by-step guide to quickly solve pyqt5 installation errors Jan 19, 2024 am 09:32 AM

Step-by-step guide to quickly solve pyqt5 installation errors

Unknown database 'database_name' - How to solve MySQL error: unknown database name Unknown database 'database_name' - How to solve MySQL error: unknown database name Oct 05, 2023 am 09:45 AM

Unknown database 'database_name' - How to solve MySQL error: unknown database name

See all articles