I recently installed mysql 5.1, then recompiled php 5.2.3 with mysql and pdo support enabled. The next step was just to install the mysql driver for PDO. The first problem was that I could not get the driver to download and install straight off the PDO repository (as you can with pear modules). The next issue looked like this:
chris@snackerjack-lx:/usr/src$ sudo pecl install PDO_MYSQL
7 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/PDO_MYSQL-1.0.2
running: /tmp/pear/cache/PDO_MYSQL-1.0.2/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
.
.etc..
.
checking for MySQL support for PDO... yes, shared
checking for mysql_config... not found
configure: error: Cannot find MySQL header files under
ERROR: `/tmp/pear/cache/PDO_MYSQL-1.0.2/configure' failed
If you trace the fatal error, it's due to the PDO configure script being unable to find the MySQL header. Go up one step further and the configure reports that it can't find mysql_config. Thchris@snackerjack-lx:/usr/src$ locate mysql_config
/usr/local/mysql/bin/mysql_config
/usr/local/mysql/man/man1/mysql_config.1
e lines below show that mysql_config is actually installed. To make matters even clearer, php was compiled with the option '--with-mysql=/usr/local/mysql/', but it seems the pecl installer doesn't think about that.
chris@snackerjack-lx:/usr/src$ locate mysql_config
/usr/local/mysql/bin/mysql_config
/usr/local/mysql/man/man1/mysql_config.1
The way I was able to fix this issue was simply by providing a symbolic link from the binary to /usr/bin/mysql_config
chris@snackerjack-lx:/usr/src$ sudo ln -s /usr/local/mysql//bin/mysql_config /usr/bin/mysql_config
The extension then compiles without problem!
hth
christo