PHP configure: error: mysqlconfigurefailed. Plea

Source: Internet
Author: User
This article is from: phpoa has not compiled and installed php for a long time. in order to play nginx, there is no way to compile and test it once. the parameters I added for compilation are: #./configure? Prefix/usr/local/php? With-config-file-path/etc? With-gd? Enable-gd-native-ttf? With-mysql? With-

From: phpoa

Php has not been compiled and installed for a long time. to play with nginx, you can compile it once for testing. the compilation parameters I added are:

#./Configure? Prefix =/usr/local/php? With-config-file-path =/etc? With-gd? Enable-gd-native-ttf? With-mysql? With-iconv-dir? With-freetype-dir? With-jpeg-dir? With-png-dir? With-zlib? With-libxml-dir? Enable-xml? Disable-debug? Disable-rpath? Enable-discard-path? Enable-safe-mode? Enable-bcmath? Enable-shmop? Enable-sysvsem? Enable-inline-optimization? With-curl? With-curlwrappers? Enable-mbregex? Enable-fastcgi? Enable-force-cgi-redirect? Enable-mbstring? With-mcrypt
I did not expect the following errors

Checking for mysql_close in-lmysqlclient... No
Checking for mysql_error in-lmysqlclient... No
Configure: error: mysql configure failed. Please check config. log for more information.

Google has been talking about the following answer for a long time: Dizzy. this is also called the answer. I don't have to re-compile mysql. This php is very troublesome. this must be wrong.

When installing PHP, I did not specify the mysql installation directory. But I have already specified this, so this statement is incorrect. The main reason is that mysql-level is not installed, that is, the mysql version is incorrect.
Mysql-max-5.0.21 version (software packages that contain all mysql-related content)

/Usr/bin/ld: skipping incompatible/usr/lib/mysql/libmysqlclient. so when searching for-lmysqlclient
/Usr/bin/ld: skipping incompatible/usr/lib/mysql/libmysqlclient. a when searching for-lmysqlclient
/Usr/bin/ld: cannot find-lmysqlclient
Collect2: ld returned 1 exit status
Configure: failed program was:
# Line 59854 "configure"
# Include "confdefs. h"

Check the error message in config. log .... Oh. it turns out that there is a problem with the version. I think my system is X86, and lib is 64-bit. so the solution is very easy.
This libmysqlclient. a library is in/usr/lib64/mysql, not in/usr/lib/mysql.
So we can do the following to solve the problem:

# Export LDFLAGS =-L/usr/lib64/mysql
OR
In Makefile
-L/usr/lib/mysql
Change
-L/usr/lib64/mysql

 

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.