Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-07-2007, 10:18 AM   #1
Registered: Jul 2005
Posts: 273

Rep: Reputation: 31
php configure: cannot find libmysqlclient

Never mind this. I just removed the --with-lib-dir option.

This is really an annoying issue, as I run into this every time, and I continue to have to come up with different solutions. This time, I'm stuck.

I'm trying to get apache / php / mysql working.
I installed apache with no issues.
I downloaded the lastest mysql rpms as well, and install those.

So here I am installing php with these terms:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-libdir=/usr/lib/mysql --with-mysql --with-mysqli --with-mcrypt=/usr/local --with-pear=/usr/local/apache2/php --with-bz2=/usr --enable-sockets --enable-dbx --enable-dbase --with-zlib --enable-mbstring --with-curl=/usr/local/bin/
And here's what it spits out at me at the end of the configure:

checking for MING support... no
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... /var/lib/mysql/mysql.sock
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
Here's the output of ldconfig which only has one /usr listed.

ldconfig -v |grep mysql -> -> -> -> -> -> -> ->
Need anything else from me to help? I'm pretty much totally lost on this one.

Last edited by neocontrol; 09-07-2007 at 10:22 AM. Reason: I'm an idiot.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-07-2007, 02:56 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
Probably just a path issue. But removing apparently works, but you'll want to make sure this didn't break any functionality for PHP with a MySQL database as well.
Old 02-03-2009, 12:43 AM   #3
LQ Newbie
Registered: Feb 2009
Posts: 1

Rep: Reputation: 3
Smile configure: error: Cannot find libmysqlclient under /usr

When I tried to run configure of PHP-5.2.8 (after installing MySQL-community 5.1.30) using

$./configure --with-mysql=/usr/bin/

I had the following problem:
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

Then I saw that libmysql client was in /usr/lib64/ instead of /usr/lib/. So the right way to run configure is:

./configure --with-mysql=/usr/bin/ --with-libdir=lib64

Hope that helps!

(Hey, PHP guys who wrote the configure script: why not include check on /usr/lib64/ as well?)
3 members found this post helpful.
Old 11-17-2009, 04:52 AM   #4
LQ Newbie
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
this works fine

this works fine on my php on opensuse 11.2
Old 07-04-2010, 10:11 AM   #5
Registered: Oct 2005
Posts: 540

Rep: Reputation: 32
Brilliant! The "--with-libdir=lib64" is what solved the problem, after downloading the devel RPM.
Old 03-02-2011, 06:08 PM   #6
Registered: Jun 2006
Posts: 32

Rep: Reputation: 3
Thumbs up Thanks!!!! 5 years later!

To YOU. Five years later this post STILL has value! Two hours of trying to get this to configure, and your suggestion saved me. Hopefully you are still a member, and hopefully you get this thanks!!!

Old 06-05-2011, 02:01 PM   #7
LQ Newbie
Registered: Aug 2003
Distribution: Red Hat Fedora
Posts: 9

Rep: Reputation: 0
Talking And it still works!

This, like the last poster, has been a life saver for me. What a fantastic long life posting from ARUNR in 2009.

Last edited by GarrathE; 06-05-2011 at 02:03 PM.
Old 07-15-2011, 12:31 AM   #8
LQ Newbie
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
Excellent! I'm another one helped by this thread, arunr's was indeed the correct fix.

I have to admit I did spend about 15 minutes before noticing the correct option is --with-libdir NOT --with-lib-dir as in the first line of the first post in the thread.
Old 07-27-2012, 03:14 AM   #9
LQ Newbie
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Smile This works! Thanks!

./configure --with-mysql=/usr/bin/ --with-libdir=lib64

Hope that helps!
I only added: --with-libdir=lib64

This helped me! Now it works! Thank you so much!
Old 11-24-2012, 07:22 AM   #10
LQ Newbie
Registered: Oct 2008
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 0
You might have to actually find the location of libmysqlclient by doing a "locate libmysqlclient" or similar. I stumbled upon this via this stackoverflow question (

For Ubuntu Precise, I had to use "--with-libdir=/lib/x86_64-linux-gnu". But arunr's answer helped me too by pointing me in the right direction! Thank you very much!!
Old 11-27-2015, 06:48 AM   #11
LQ Newbie
Registered: Nov 2015
Posts: 1

Rep: Reputation: Disabled
./configure --with-mysql=/usr/bin/ --with-libdir=lib64

Worked for me too.



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
PHP configure error: Cannot find libz ridertech Linux - Software 2 08-08-2008 10:14 PM
libmysqlclient error when running a php script rose_bud4201 Linux - Software 2 06-03-2005 01:43 PM
MySQL and PHP: incompatible libmysqlclient library dciric Linux - Software 1 05-31-2004 12:18 PM
Where can I find libmysqlclient.so10? Tiyogi Linux - Software 4 05-04-2004 07:24 AM
Can't find php configure NW Otter Linux - Software 1 09-24-2003 12:33 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:50 PM.

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