The /usr/lib/php5/build/acinclude.m4 file looks for PDO header files in $prefix/include/php/ext/pdo/php_pdo_driver.h, but they are actually in $prefix/include/php5/ext/pdo/php_pdo_driver.h on Ubuntu. This bug stops PHP PDO extensions from compiling.
Current PHP source: https://github.com/php/php-src/blob/96220027e12d72b295808081136dee66bc3a9d61/acinclude.m4#L2774
dnl
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
dnl
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$prefix/include/php/ext
fi
])
Additional references to this issue:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647475 Debian.org - php5-dev: acinclude.m4's PHP_CHECK_PDO_INCLUDES fails to look in the right place for php_pdo_driver.h
https://bugs.php.net/bug.php?id=59450 PHP.net - ./configure fails with "Cannot find php_pdo_driver.h"
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511900 Debian.org - php5: Compiling pdo_oci extension fails with "Cannot find php_pdo_driver.h."
Description: Ubuntu 14.04.2 LTS
Release: 14.04
php5-dev:
Installed: 5.5.9+dfsg-1ubuntu4.5
Candidate: 5.5.9+dfsg-1ubuntu4.5
Version table:
*** 5.5.9+dfsg-1ubuntu4.5 0
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.9+dfsg-1ubuntu4 0
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
A temporary workaround:
sudo ln -s /usr/include/php5/ /usr/include/php
This patch changes the php_pdo_driver location test from php/ to php5/:
- elif test -f $prefix/ include/ php/ext/ pdo/php_ pdo_driver. h; then inc_path= $prefix/ include/ php/ext include/ php5/ext/ pdo/php_ pdo_driver. h; then inc_path= $prefix/ include/ php5/ext
- pdo_cv_
+ elif test -f $prefix/
+ pdo_cv_
Seems like the correct solution to me, but I could be completely wrong. Thanks