php / mysql : Cannot find MySQL header files

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
biker007fr
Forum Newbie
Posts: 14
Joined: Thu Jun 09, 2005 7:11 am

php / mysql : Cannot find MySQL header files

Post by biker007fr »

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?!
:idea: :?:
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

this isn't really the right forum for this, try looking at PHP and MySQL-installation notes, or try google which most asurely has several topics about this.
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

That's because your distro *probably* stores the MySQL libraries and include files separately. Try configuring it --with-mysql=/usr/include/mysql:/usr/lib/mysql

-- Scorphus
biker007fr
Forum Newbie
Posts: 14
Joined: Thu Jun 09, 2005 7:11 am

Post by biker007fr »

Yes, my distro stored MySQL libraries and include files separately in /usr/include/mysql and /usr/lib/mysql.
No result for : /usr/include/mysql:/usr/lib/mysql

-> configure: error: Cannot find MySQL header files under /usr/include/mysql:/usr/lib/mysql

I tried to search a response on google (it was my 1st try) but no answer... Now I hope that someone will find a solution on this forum or another one

It has been 3 days by now and this problem gets on my nerves :evil:

Thanks for your help anyway :wink:
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Humm... well, let's try more... did you try --with-mysql=shared,/usr or just --with-mysql=/usr already?

What have you tried so far?

-- Scorphus

p.s.: please do not cross-post, let the forum moderators move your message to the right forum if they they think so. Take a read: Before Post Read: General Posting Guidelines
biker007fr
Forum Newbie
Posts: 14
Joined: Thu Jun 09, 2005 7:11 am

Post by biker007fr »

I tried :
./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include/mysql
./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include
./configure --with-apxs2=/usr/bin/apxs --with-mysql=shared,/usr/include/mysql
./configure --with-apxs2=/usr/bin/apxs --with-mysql=shared,/usr/include

./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/lib/mysql
./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/lib
./configure --with-apxs2=/usr/bin/apxs --with-mysql=shared,/usr/lib/mysql
./configure --with-apxs2=/usr/bin/apxs --with-mysql=shared,/usr/lib

./configure --with-apxs2=/usr/bin/apxs --with-mysql=/usr/include/mysql:/usr/lib/mysql

The worst is that my MySQL Database works fine... So I don't think that it was a bad install
By the way, what does "shared" mean?
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

biker007fr wrote:(...) The worst is that my MySQL Database works fine... So I don't think that it was a bad install (...)
What distro are you running? (just curious)
biker007fr wrote:(...) By the way, what does "shared" mean?
Well, it means that support for MySQL in PHP will be built as a module (a binary file apart from the PHP binary file).

So, what did --with-mysql=shared,/usr return?

-- Scorphus
biker007fr
Forum Newbie
Posts: 14
Joined: Thu Jun 09, 2005 7:11 am

Post by biker007fr »

Case : --with-mysql=/usr
for $> ./configure
no error
for $> make
no error
for $> make install
no error
But Fatal error: Call to undefined function: mysql_connect() when I want to use this mysql function... So It doesn't work

Case : --with-mysql=shared,/usr
for $> ./configure
no error
for $> make
ext/mysql/php_mysql.lo(.text+0x22dc): In function `zif_mysql_create_db':
/home/php438/php-4.3.8/ext/mysql/php_mysql.c:1160: undefined reference to `mysql_create_db'
ext/mysql/php_mysql.lo(.text+0x2513): In function `zif_mysql_drop_db':
/home/php438/php-4.3.8/ext/mysql/php_mysql.c:1202: undefined reference to `mysql_drop_db'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Erreur 1

GGrrrr....
biker007fr
Forum Newbie
Posts: 14
Joined: Thu Jun 09, 2005 7:11 am

Post by biker007fr »

MySQL 4.1
PHP 4.3.8
Apache 2

I'm still on trouble... HELP
biker007fr
Forum Newbie
Posts: 14
Joined: Thu Jun 09, 2005 7:11 am

Post by biker007fr »

Finally, I use another version of MySQL (4.1.12 instead of 4.1.9), PHP (4.3.9 instead of 4.3.8) and now I have just a "Client does not support authentication protocol" which proves that it works even if I have to upgrade Mysql client.

Thanks
Post Reply