PHP compilation error configure error Cannot find libmysqlclient under usr Solution

Source: Internet
Author: User

An error occurred while compiling PHP5.2.6 on 64-bit Red Hat Enterprise Linux AS release 4.7. 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... nochecking for MySQ L unix socket location... noconfigure: error: Cannot find libmysqlclient under/usr. Note that the MySQL client library is not bundled anymore!

Find libmysqlclient and find it in the/usr/lib64/mysql/directory. so.16.0.0 is a soft connection. PHP searches for/usr/lib/by default, so it cannot be found. after finding the problem, we can solve it.

Similar issues include:

/usr/lib/libjpeg.so -> /usr/lib64/libjpeg.so

Solution:

1.

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

2.

/usr/lib64/libmysqlclient.so -> libmysqlclient.so.16.0.0/usr/lib/libmysqlclient.so -> /usr/lib64/libmysqlclient.sochecking whether to enable embedded MySQLi support… nochecking for mysql_set_server_option in -lmysqlclient… noconfigure: error: wrong mysql library version or lib not found. Check config.log for more information

After testing, the following solutions are found:

(Php-xxxxx is the php file name, indicating 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

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.