php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56790 Configure of all PDO drivers fails if PDO is a shared extension (PHP5.1.2 only)
Submitted: 2006-01-21 11:08 UTC Modified: 2006-08-05 15:04 UTC
From: chtekk at gentoo dot org Assigned:
Status: Closed Package: PDO (PECL)
PHP Version: 5.1.1 OS: Gentoo Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chtekk at gentoo dot org
New email:
PHP Version: OS:

 

 [2006-01-21 11:08 UTC] chtekk at gentoo dot org
Description:
------------
Hi, while testing PHP 5.1.2 on Gentoo I have encountered what I think is a bug (the following problem was confirmed by various users of our PHP packages).
While compiling some PDO drivers (MySQL, PostgreSQL, SQLite, OCI, DBLIB), the configure died. Strangely, this only applied to the PECL packages I just mentioned, other PHP5 PECL packages/extensions we ship compile fine, as does PDO itself and the ODBC driver (this is because of another bug, see http://pecl.php.net/bugs/bug.php?id=6544 ).
The error is always the following:



>>> Source unpacked.
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025
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
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr/lib/php5
checking for PHP includes... -I/usr/lib/php5/include/php -I/usr/lib/php5/include/php/main -I/usr/lib/php5/include/php/TSRM -I/usr/lib/php5/include/php/Zend -I/usr/lib/php5/include/php/ext
checking for PHP extension directory... /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20050922
checking for PHP installed headers prefix... /usr/lib/php5/include/php
checking for re2c... re2c
checking for re2c version... 0.9.11 (ok)
checking for gawk... gawk
checking for MySQL support for PDO... yes, shared
checking for mysql_config... /usr/bin/mysql_config
checking for mysql_query in -lmysqlclient... yes
checking for mysql_commit... yes
checking for mysql_stmt_prepare... yes
checking for mysql_next_result... yes
checking for mysql_sqlstate... yes
checking for PDO includes... checking for PDO includes... /usr/lib/php5/include/php/ext
configure: error:
You've configured extension pdo_mysql, which depends on extension pdo,
but you've either not enabled pdo, or have disabled it.


!!! ERROR: dev-php5/pecl-pdo-mysql-1.0.1 failed.



Now, PDO itself is installed correctly and the PDO includes are in the right place, so I investigated this a little. On PHP 5.1.1 this all worked perfectly, with the upgrade to 5.1.2 it started to fail...
I searched for the piece of code in the PHP 5.1.2's phpize generated configure that held that particular error message, wich is the following:



  am_i_shared=$PHP_PDO_MYSQL_SHARED
  is_it_shared=$PHP_PDO_SHARED
  if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then
    { { echo "$as_me:$LINENO: error:
You've configured extension pdo_mysql to build statically, but it
depends on extension pdo, which you've configured to build shared.
You either need to build pdo_mysql shared or build pdo statically for the
build to be successful.
" >&5
echo "$as_me: error:
You've configured extension pdo_mysql to build statically, but it
depends on extension pdo, which you've configured to build shared.
You either need to build pdo_mysql shared or build pdo statically for the
build to be successful.
" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "x$is_it_shared" = "x" && test "x" != "xtrue"; then
    { { echo "$as_me:$LINENO: error:
You've configured extension pdo_mysql, which depends on extension pdo,
but you've either not enabled pdo, or have disabled it.
" >&5
echo "$as_me: error:
You've configured extension pdo_mysql, which depends on extension pdo,
but you've either not enabled pdo, or have disabled it.
" >&2;}
   { (exit 1); exit 1; }; }
  fi



Now, to output that error message, the second if block is entered and configure dies. The second if block is entered only if $is_it_shared is empty, and $is_it_shared is defiend earlier with is_it_shared=$PHP_PDO_SHARED, and that's as far as I can see the problem: $PHP_PDO_SHARED is never defined in the configure script, so it's empty, validating the test and letting the configure die. On a PHP 5.1.1's phpize generated configure for the same package, those lines of code don't even exist, so it's definitely a problem introduced with PHP 5.1.2, I hope it can be fixed quickly. :)
Best regards, CHTEKK.

P.S.: This may be partially related to bug http://pecl.php.net/bugs/bug.php?id=6117 , but I don't think so as we don't use the pear or pecl binaries to install our PECL packages, but compile them from scratch with phpize, configure and make.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-20 08:54 UTC] sweet_philippe at hotmail dot com
I have exactly the same probem compiling PDO_OCI-1.0 from scratch with phpize, configure and make !! (php-5.1.2-5 on redhat Fedora Core 5)
 [2006-04-27 06:32 UTC] tim dot n dot hunt at gmail dot com
Same problem on php 5.1.2 on suse, compiled php from source with pdo and pdo_mysql as shared modules.

Pdo worked fine and managed to access mysql database. 

Compiled PDO-1.0.2.tgz from source without a problem but trying to update pdo_mysql using PDO_MYSQL-1.0.1.tgz fails, output is as described in other messages.

Trying the workarounds suggested in bug 6117
 [2006-05-01 22:27 UTC] wez@php.net
Why are you building PHP 5.1.2 with old PECL packages when PHP 5.1.2 ships with the latest versions?
 [2006-08-05 15:04 UTC] chtekk at gentoo dot org
Cause we offer the possibility to use PECL modules as alternative to the in-PHP modules, this way we also provide PDO for PHP 5.0.5 (through the PECL modules). It's just how flexible we are... ;) Anyway this seems to all be fixed with PHP 5.1.4, we reconduced it to the PHP_ADD_EXTENSION_DEP macro being slightly broken in 5.1.2, but it was then fixed, so closing this.
Best regards, CHTEKK.
 [2006-08-14 10:08 UTC] terry dot cullen at uq dot edu dot au
This exact issue is alive and well in 5.1.4 and 5.1.5 on Solaris 10x86
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC