Home > Article > Backend Development > Building php environment under linux
1. Install mysql, zlib, etc.
Problem record
1. configure: error: Cannot find MySQL header files under /usr/include/mysql.
Note that the MySQL client library is not bundled anymore!
Prompt me to find I couldn’t find the MySQL header files
I checked online and used find / -name mysql.h to find that /usr/include/mysql/mysql.h does exist
My mysql was installed with the official rpm package
server client devel share -compat is all installed...
I am new to the Linux field and I am asking for some advice. I would be very grateful
Oh, I guess it is mostly a 64-bit problem. Problems encountered when installing software on 64-bit systems are often caused by library paths. The problem should be solved by pressing dongboemil. Either PHP specifies the preconfigured parameter MYSQL library path, or the MYSQL library is copied or soft-linked to the directory that PHP looks for by default.
-with-mysql=/usr/include/mysql, this parameter should be wrong,
change it to
--with-mysql
or
--with-mysql=/usr
Try it
because your MYSQL is RPM Install it according to the system path
If it still doesn’t work, please note that every time you re-preconfigure, do this first:
make clean
Then re-preconfigure and compile
Unexpectedly, the following error always occurs
checking for mysql_error in -lmysqlclient… no
configure: error: mysql configure failed. Please check config.log for more information.
mysql-max-5.0.21 (a software package that contains all mysql-related content) )
/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"
This libmysqlclient.a library is in /usr/lib64/ mysql, is not in /usr/lib/mysql.
So you can do the following method to solve it
OR
Please change
-L/usr/lib/ in the Makefile mysql
changed to
-L/usr/lib64/mysql