1

I am trying to compile PHP with mysql_pdo on CentOS 6 and I am having just one heck of a time trying to make it happen. Currently I am trying to compile PHP 5.2, but I am going to have to do this for 5.3 as I need to change versions.

Here is the configure command I am using:

./configure --with-apxs2 --with-mysql --with-mysqli --with-curl -enable-soap -enable-sockets --enable-mbstring --with-gd --with-mcrypt --with-pdo-mysql=/usr/bin/mysql 

I installed MySQL and mysql-devel from a repository and the error I get is below:

configure: error: PDO_MYSQL configure failed. Please check config.log for more information 

When I check config.log, the last line I see is:

configure:72788: checking for mysql_query in -lmysqlclient

I have a feeling that I am using the wrong value for the --with-pdo-mysql, but I have tried not giving it a path or telling it to use mysqlnd and I get an error saying it can't find mysql and if I leave it blank, it gives me the same error when I put the path in.

Anyone have any ideas?

EDIT: I have no idea if this is relevant or not, but I found that I have libmysqlclient.so files located at /usr/lib/mysql.

4
  • Have you tried to install mysql-client too? Commented Apr 24, 2012 at 15:12
  • There is not a package called mysql-client that I am able to see. It looks like CentOS bundles the client into the regular mysql package. Commented Apr 24, 2012 at 15:24
  • A few ideas: a) You can try omitting the path entirely (--with-mysql-pdo), or using --with-mysql-pdo=/usr (it is not uncommon to retrieve the need paths from mysql_config - files can be symlinked to /usr/lib and /usr/include if you use an atypical install location) b) in PHP 5.3+ you can (and should) use the native driver instead: --with-pdo-mysql=mysqlnd c) finally, you usually shouldn't have to compile PHP. It is provided in the base repository, with additional modules available from EPEL. Commented Apr 24, 2012 at 23:37
  • Can you try installing libmysqlclient* and see if this resolves the issue? Commented Nov 29, 2015 at 20:00

1 Answer 1

-1

Try to avoid install software from source it's a bad practice. I'd suggest to install IUS Community repo . After that just install necessary packages

# yum install php53u-pdo.x86_64 php53u-mysql.x86_64 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.