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