Compile PHP Error Configure error cannot find libmysqlclient under USR solution _php tips

Source: Internet
Author: User
Tags mysql client php error

Today in the 64-bit red Hat Enterprise Linux as Release 4.7 Compile PHP5.2.6 error, MySQL is used by the RPM method installed, PHP compiled code 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-- Enable-mbstring--with-gd--with-jpeg-dir--with-png-dir--with-zlib-dir--enable-sysvsem The following error occurred: Checking for Specified location of the MySQL UNIX socket ... no checking for
mysql UNIX socket location ... no
configure:error: Cannot find Libmysqlclient under/usr.
The MySQL client library is not bundled anymore!

By looking for libmysqlclient, found to be a soft connection made in the/usr/lib64/mysql/directory libmysqlclient.so.16.0.0, PHP defaults to go to the/usr/lib/search, So I didn't find it. We found the problem and we solved it.

Similar questions are:

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

Workaround:

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.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

After testing, we found the following solutions:

(Php-xxxxx is the PHP filename, representing the path)

# cd/usr/local/src/php-xxxxx/ext/mysqli #
yum-y install mysql-devel
#/phpize
with-php-config=/php-config–enable-embedded-mysqli=shared–enable-shared
# make
Install

The screen will print mysqli.so generated path, in php.ini Riga

/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.