LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 09-14-2004, 07:06 PM   #1
ldp
Member
 
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Rep: Reputation: 18
php5 ./configure error: Cannot find MySQL header files


Hi,

Untill now, I've been using apache2, mysql, php4 without any troubles.

But I wanted to switch over to php5 because of the improved class-object system.

But ./configuring the php5 module seems to give a lot of trouble. (in contradiction to php4)
It started with the libxml2 - problem (which can be seen in many posts) and was solved by manually configuring, make and make-installing the version 2.5.10 instead of the apt-get 2.6.x version.
And now, I get this error:
"...
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find MySQL header files under /usr/local/src/php-4.3.7/ext/mysql/libmysql.
Note that the MySQL client library is not bundled anymore."

I used: ./configure
--with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/src/php-4.3.7/ext/mysql/libmysql
--with-gd --with-zlib --enable-sockets --enable soap

the "--with-mysql=/usr/local/src/php-4.3.7/ext/mysql/libmysq" was changed from originally "--with-mysql" because it gave the same error.
I did a find / -name mysql.h to find out where these headers are and it turned out to be this directory: "/usr/local/src/php-4.3.7/ext/mysql/libmysq"
But the error didn't go away.

I've been googling and forum-searching for some time now but can't figure out a correct solution to this.

If you've got a clue, please let me know. I'm about to install a new version of mysql in the hope (vain?) that this problem would go away.

btw: I've been ./configuring quite a few times now, hope that it don't matter.

Any help is appreciated.

thanks and regards,
Lieven

Last edited by ldp; 09-14-2004 at 07:10 PM.
 
Old 09-15-2004, 05:44 AM   #2
ldp
Member
 
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Original Poster
Rep: Reputation: 18
Anybody got any ideas here? Or has this question been answered before maybe? Just a hint could help me out here.
thanks.
 
Old 09-15-2004, 05:52 AM   #3
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Where is your mysql installed? You must point the --with-mysql= to that directory.
 
Old 09-15-2004, 06:31 AM   #4
ldp
Member
 
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Original Poster
Rep: Reputation: 18
Thanks but it didn't work. (except if I did wrong)

1:
root@lieven:/usr/local/src/php-5.0.1# whereis mysql
mysql: /usr/bin/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

2:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/bin/mysql --with-gd --with-zlib --enable-sockets --enable-soap

3:
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find MySQL header files under /usr/bin/mysql.
Note that the MySQL client library is not bundled anymore.

Thus I have the same error as before.
 
Old 09-15-2004, 07:18 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
How did you installed mysql? From source or from binary? Anyway in my installation there is a directory "include" under mysql tree with all the mysql header files. You can also try:
Code:
find / -name mysql.h
to find out where are the headers.
 
Old 09-15-2004, 08:10 PM   #6
ldp
Member
 
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Original Poster
Rep: Reputation: 18
problem was that the mysql was allready on the distribution installation for some vague reason. (using knoppix 3.4 here) And the folders seemed to be impossible to find.
So I just downloaded the mysql source for a newer version 4.1 instead of 4.0 and configured and installed it.
Now, the ./configure for the php5 worked fine.
Is making now, can take some time on the old K6-II 300MHz.
(making mysql took almost an hour )
thanks for the replies.
rgds,
Lieven
 
Old 09-30-2004, 11:24 PM   #7
LLS
Member
 
Registered: Sep 2003
Location: North America
Distribution: FC6 FC7 F8
Posts: 75

Rep: Reputation: 15
Just ran into that tonight, I just stoped MySQL and then ran make again and it resolved and was successfull.
 
Old 11-16-2004, 07:25 PM   #8
teddyted
LQ Newbie
 
Registered: Nov 2004
Location: USA
Distribution: SuSe 9.1 Pro
Posts: 8

Rep: Reputation: 0
cannot find MySQL header files ...

Folks, I am having the same problem.
I tried to do
find / -name mysql.h
and found out only the ones located in the PHP4-XXX /ext/mysql/libmysql/
tried those and still the same error.
Do I have to reinstall MySQL?
"Share your Experience!"
Thanks,
Teddy
 
Old 11-29-2004, 09:41 PM   #9
npj
LQ Newbie
 
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
Re: cannot find MySQL header files ...

Quote:
Originally posted by teddyted
Folks, I am having the same problem.
I tried to do
find / -name mysql.h
and found out only the ones located in the PHP4-XXX /ext/mysql/libmysql/
tried those and still the same error.
Do I have to reinstall MySQL?
"Share your Experience!"
Thanks,
Teddy
I had the same problem too, on Debian Woody 3.0.

To solve it, I didn't need to reinstall MySQL - what I did was this:
apt-get install libmysqlclient10-dev
(this installs the MySQL client libraries - presumably SUSE has a similar extra package)

And then configure PHP5, pointing to the location where the MySQL client libraries were installed to, like so:
./configure --disable-libxml --with-mysql=/usr/include/mysql/

Then configure worked.
 
Old 01-16-2007, 03:14 AM   #10
slusiola
LQ Newbie
 
Registered: Jan 2007
Posts: 1

Rep: Reputation: 0
For SUSE, use yast2 to install mysql-devel and everything will be hunky-dory ( at least for me it was)
 
Old 05-07-2007, 06:55 PM   #11
monguesto
LQ Newbie
 
Registered: May 2007
Posts: 1

Rep: Reputation: 0
Solution for Fedora

Solution for fedora is yum install mysql-devel. Then set --with-mysql=/usr/include/mysql/
 
Old 07-03-2007, 03:54 AM   #12
steriojose
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
How to do it with Red Hat 4

Forget my post, it doesn't work, if you find the solution for red hat 4 enterprise edition I will thank you

Hello, I installed mysql 5 from the rpm's, and I have become crazy until I have proven the following thing:
./configure <blablabla> --with-MySQL
(write My-SQL, since the packages rpm of mysql 5 distinguish caps from small letters)
(sorry for my horrible english, i used the google translator), cheers from spain

Last edited by steriojose; 07-03-2007 at 08:25 AM.
 
Old 07-09-2007, 03:18 PM   #13
kplimack
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
solution

I assume you're all installing based on the PHP install guide which says:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql

At this point, you've probably already installed apache and mysql

the first part of this command is pointing the config script at you're apache directory.
the second part is pointing it at the mysql directory, but that isn't clear here

if you installed mysql according to the guidelines, its probably in /usr/local/mysql (because you did a ln -s to create the link).

so do this (from inside the php-nn dir):

./configure --with-axps2=/usr/local/apache2/bin/apxs --with-mysql=../mysql
or
./configure --with-axps2=/usr/local/apache2/bin/apxs --with-mysql=/FULL_PATH_TO_MYSQL_DIR/
 
Old 07-30-2007, 05:26 PM   #14
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: CentOS 5.5, Ubuntu 10.04, Linux Mint 11 gnome 64 bit
Posts: 336

Rep: Reputation: 36
Ubuntu: php and apache (from source) and
mysql (from package install)

/usr/local/php-5.2.3# apt-get install libmysqlclient12-dev

./configure \
--with-apxs2=/usr/local/apache2.2.3/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache2.2.3/php \
--with-config-file-path=/usr/local/apache2.2.3/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext

Where --with-config-file-path
copies the php.ini automatically

Fixed

Quote:
Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
...

Thank you for using PHP.
 
Old 08-01-2007, 02:32 PM   #15
activeco
LQ Newbie
 
Registered: Sep 2005
Location: Milky Way
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by monguesto
Solution for fedora is yum install mysql-devel. Then set --with-mysql=/usr/include/mysql/
Thank you monguesto. I have spent a few hours looking for the right solution and almost dived into reinstalling mysql, with all the possible horrors connected with it.
You are the hero of the day!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
configure php5 and mysql issue jiawj Programming 1 08-17-2005 04:34 PM
Error compiling PHP5 with MySQL Boby Linux - Software 3 09-10-2004 10:17 PM
./configure php5 error - log included Transition Linux - Newbie 4 07-16-2004 09:11 AM
./configure not finding header files mikeyt_333 Linux - Software 5 06-30-2004 07:09 PM
vmware error, cant find c header files artofluke Slackware 9 09-02-2003 08:35 AM


All times are GMT -5. The time now is 07:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration