2

I am currently setting up a PHP 5.2 server (yes I know, but it is actually needed in this case) but I keep getting an error:

configure: error: Cannot find libmysqlclient under /usr.

The command that I am running is:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-libdir

I have installed libmysqlclient and when I run

locate libmysqlclient

I get results returned, although none of them are the file libmysqlclient (the closest is libmysqlclient.a)

I would greatly appreciate any help that can be provided.

2
  • as I recall, the mysql stuff is wonky, and you have to point configure at the parent directory. e.g. if the lib's in /foo/bar/baz/libmysql.so, you have to do --with-mysql=/foo/bar instead.
    – Marc B
    Sep 9, 2014 at 15:44
  • I gave this a shot and no such luck.
    – inimrepus
    Sep 9, 2014 at 15:47

1 Answer 1

4

Try using the DIR directive

--with-mysql --with-libdir=/lib/i386-linux-gnu/

From Cannot find libmysqlclient under /usr. while build PHP 5.2 from source on Ubuntu 12.4

Updated from your comment!

8
  • What OS are you using Ubuntu? Did you compile libmysql or install from repo?
    – beiller
    Sep 9, 2014 at 15:44
  • Using Ubuntu, I installed libmysql from repo.
    – inimrepus
    Sep 9, 2014 at 15:45
  • 1
    --with-mysql --with-libdir=/lib/x86_64-linux-gnu Updated answer try that
    – beiller
    Sep 9, 2014 at 15:47
  • No luck. Does it make a difference that the server is x32?
    – inimrepus
    Sep 9, 2014 at 15:50
  • Got it working largely because of your answer. I used ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-libdir=/lib/i386-linux-gnu/
    – inimrepus
    Sep 9, 2014 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.