Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I downloaded php binaries and tried to build the same using following command.

./configure --with-apxs2=/usr/sbin/apxs --with-mysql

But i'm getting the error related to mysql client library.

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 MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!

I confirmed that I have mysql client installed.

$ yum list mysql*
Loaded plugins: rhnplugin, security
Installed Packages
MySQL-client-community.x86_64    5.1.48-1.rhel5   installed
MySQL-server-community.x86_64    5.1.48-1.rhel5   installed
share|improve this question

For building stuff you need the -devel packages too, the plain packages just contain runtime.

Why are you trying to build PHP? What do you think is wrong with the package provides by the ditribution? The version might be old, but I can assure you it has (backports of) all the security patches.

share|improve this answer
Well, i had php 5.1, but one of the new applications needs php 5.2. So, I first removed 5.1 version (yum remove php*). Then downloaded php 5.2 binaries from php.net and simply followed the process given on their website for configuring PHP with Apache 2.x and mysql support. MySQL version is 5.1.48-community. Also, I am not sure which -devel packege is required to be installed. Please help. – Mangesh Jogade Mar 21 '13 at 9:06
What requires PHP 5.2? Not an official package... – vonbrand Mar 21 '13 at 10:45
a perticular web application requires PHP 5.2 only ... – Mangesh Jogade Apr 19 '13 at 14:51

After searching a lot of pages on Google i have figured it out that i need to install mysql-devel package

$ rpm -ivh MySQL-devel-community-5.1.48-1.rhel5.i386.rpm

This created required header files under /usr/include/mysql

Then i executed command : $ ./configure --with-apxs2=/usr/sbin/apxs --with-mysql-dir=/usr/

It resolved the error.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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