Click to See Complete Forum and Search --> : php / mysql : Cannot find MySQL header files


biker007fr
06-09-2005, 10:40 AM
Hi everyone!
I have to make php with the mysql option to use my mysql database but there is something wrong and I didn't find the solution... This is the error message :
configure: error: Cannot find MySQL header files under /usr/include/mysql

There is how I remake php :
$> ./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include/mysql

In /usr/include/mysql I have the header files as you can see below :
chardefs.h
errmsg.h
history.h
keycache.h
keymaps.h
libmysqlclient_r.so
libmysqlclient_r.so.10
libmysqlclient_r.so.10.0.0
libmysqlclient_r.so.12
libmysqlclient_r.so.12.0.0
libmysqlclient_r.so.14
libmysqlclient_r.so.14.0.0
libmysqlclient.so
libmysqlclient.so.10
libmysqlclient.so.10.0.0
libmysqlclient.so.12
libmysqlclient.so.12.0.0
libmysqlclient.so.14
libmysqlclient.so.14.0.0
m_ctype.h
m_string.h
my_alloc.h
my_config.h
my_dbug.h
my_dir.h
my_getopt.h
my_global.h
my_list.h
my_net.h
my_no_pthread.h
my_pthread.h
my_semaphore.h
mysql_com.h
mysqld_error.h
mysql_embed.h
mysql.h
mysql_time.h
mysql_version.h
my_sys.h
my_xml.h
raid.h
readline.h
rlmbutil.h
rlprivate.h
rlshell.h
rltypedefs.h
sql_common.h
sql_state.h
sslopt-case.h
sslopt-longopts.h
sslopt-vars.h
tilde.h
typelib.h
xmalloc.h

I have put libmysqlclient.so in /usr/include/mysql so that all files needed by php are in the same directory but NOTHING! It's not working!

PLEASE, ANY IDEA?!

brownerg
09-07-2005, 12:29 PM
When using the with-mysql option you must point it to the installation directory....NOT the include directory itself.

In my case i would use with-mysql=/usr/local/mysql

cantona762
10-07-2005, 02:14 AM
try others path..

--with-mysql-dir=/usr/

keep trying.....
I get it right for the above path

cheers~
:)

kaka-ra-smaka
10-20-2005, 05:46 AM
I did the

--with-mysql-dir=/usr/

thing, and life is good once again.

thank god, I was really getting pissed off.

THANK YOU :rolleyes:

kurund
07-25-2007, 08:47 AM
create symb link for mysql_config

sudo ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config

HTH

kurund

jjheap
11-10-2008, 05:24 PM
Having spend some time figuring this one out here is the answer (for me at least)

You need to install the MySQL-develp package

eg.

MySQL-devel-5.0.67-0.i386.rpm

and also amend you configure script to --enable-mysql=/<path>

where <path> is typically /usr

happy building.

jdmfontz
04-08-2009, 12:59 PM
Hello,

Just a follow-up for whatever is worth. I had the same problem and resolved by installing MySQL-devel-community-5.1.30-0.rhel5.i386.rpm.

Martin

telmolr
04-22-2010, 05:59 PM
Hi ...

You need to install the lib mysql!

In Debian or Ubuntu: aptitude install libmysql++-dev

Telmo Lemos da Rosa




Hi everyone!
I have to make php with the mysql option to use my mysql database but there is something wrong and I didn't find the solution... This is the error message :
configure: error: Cannot find MySQL header files under /usr/include/mysql

There is how I remake php :
$> ./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include/mysql

In /usr/include/mysql I have the header files as you can see below :
chardefs.h
errmsg.h
history.h
keycache.h
keymaps.h
libmysqlclient_r.so
libmysqlclient_r.so.10
libmysqlclient_r.so.10.0.0
libmysqlclient_r.so.12
libmysqlclient_r.so.12.0.0
libmysqlclient_r.so.14
libmysqlclient_r.so.14.0.0
libmysqlclient.so
libmysqlclient.so.10
libmysqlclient.so.10.0.0
libmysqlclient.so.12
libmysqlclient.so.12.0.0
libmysqlclient.so.14
libmysqlclient.so.14.0.0
m_ctype.h
m_string.h
my_alloc.h
my_config.h
my_dbug.h
my_dir.h
my_getopt.h
my_global.h
my_list.h
my_net.h
my_no_pthread.h
my_pthread.h
my_semaphore.h
mysql_com.h
mysqld_error.h
mysql_embed.h
mysql.h
mysql_time.h
mysql_version.h
my_sys.h
my_xml.h
raid.h
readline.h
rlmbutil.h
rlprivate.h
rlshell.h
rltypedefs.h
sql_common.h
sql_state.h
sslopt-case.h
sslopt-longopts.h
sslopt-vars.h
tilde.h
typelib.h
xmalloc.h

I have put libmysqlclient.so in /usr/include/mysql so that all files needed by php are in the same directory but NOTHING! It's not working!

PLEASE, ANY IDEA?!