famsf / pecl-pdo-4d

SVN->Git of the PHP PECL PDO 4D extension http://svn.php.net/repository/pecl/pdo_4d/ plus bugfixes
3 stars 12 forks source link

Ubuntu Support /usr/include/php5 #1

Closed RickSeymour closed 9 years ago

RickSeymour commented 9 years ago

Add support for detection of php include directory

13rac1 commented 9 years ago

Ah... ha! I forgot what this issue with this was. I've already filed a bug against Ubuntu for this specific problem: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1393640 which is linked from: https://bugs.php.net/bug.php?id=59450

I wasn't trying to fork the pecl-pdo-4d extension with this repo, just make it easier for people to compile it with the required bugfixes in place. Ubuntu/Debian changes the default install location of PHP, but doesn't change it in /usr/lib/php5/build/acinclude.m4 The solution needs to be in Ubuntu/Debian, not upstream in the PHP sources. This repo compiles correctly against the original PHP source: https://github.com/php/php-src

My suggested workaround for Ubuntu/Debian is:

sudo ln -s /usr/include/php5/ /usr/include/php

Since you've also run into this issue can you please "vote" on it by logging on LaunchPad, subscribing and clicking "affects me"? This will raise the bug heat to 12 and perhaps get it noticed.

13rac1 commented 9 years ago

This specific issue should/could be documented in the README, but the PHP devs will (probably) never commit the change to the official SVN repo since it's caused downstream.

13rac1 commented 9 years ago

Here is an example of the problem on a current Ubuntu 14.04 install:

$ grep "php/" /usr/lib/php5/build/acinclude.m4 -n
2770:    if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
2774:    elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
2775:      pdo_cv_inc_path=$prefix/include/php/ext

Here's a diff to fix it:

--- acinclude.m4.old    2015-01-14 00:08:45.085268882 +0000
+++ acinclude.m4        2015-01-14 00:09:04.185268568 +0000
@@ -2771,8 +2771,8 @@
       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
+    elif test -f $prefix/include/php5/ext/pdo/php_pdo_driver.h; then
+      pdo_cv_inc_path=$prefix/include/php5/ext
     fi
   ])
   if test -n "$pdo_cv_inc_path"; then

You need to clean the entire repo before running phpize and configure again:

git clean -f

Update: I've added the above patch to the Launchpad issue.

13rac1 commented 9 years ago

Closing. Please "vote" on the launchpad issue by logging in, subscribing, and clicking "affects me" at: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1393640