php5 ./configure error: Cannot find MySQL header files
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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:
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
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
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/
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 07:25 AM.
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/
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.