php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56480 PECL PDO-drivers don't build if php compiled --without-pdo
Submitted: 2005-08-05 09:33 UTC Modified: 2005-09-12 05:54 UTC
From: akorthaus at web dot de Assigned: wez (profile)
Status: Closed Package: PDO (PECL)
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: akorthaus at web dot de
New email:
PHP Version: OS:

 

 [2005-08-05 09:33 UTC] akorthaus at web dot de
Description:
------------
If php was build --without-pdo, PDO-drivers don't build because of missing header-files.

Installing PDO works fine, but when installing a driver I get:

configure: error: Cannot find php_pdo_driver.h

seems if PDO does not copy needed header-files to ect/pdo.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-05 10:04 UTC] akorthaus at web dot de
php_pdo.h is missing too, so make fails.
 [2005-08-06 17:36 UTC] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug.

PDO support must be built into php itself.
 [2005-08-06 19:30 UTC] wez@php.net
Sounds like a bug to me.
 [2005-08-07 05:38 UTC] akorthaus at web dot de
I know that there is PDO-support in PHP itself. But as far as I understood the PECL-Packages should work with future versions of PHP too, so you can install PDO-updates from PECL, even if there is no new release of php-core.

That's what future Gentoo-Linux Packages for PHP will rely on: http://stu.gnqs.org/diary/gentoo.php/2005/07/31/php_overlay_updated

When installing PHP you can choose PDO from php-core ("pdo" USE-Flag) or PDO packages from PECL ("pdo-external" USE-Flag), which can be updated separately later. If this should not be done for future PHP versions, please let me know!

The problem described in this bug report happens if I try to install such PECL-Packages (Drivers) for PDO, when PHP was compiled with "--without-pdo", which leads to the missing header-files in ext/pdo. And when I install PECL-pdo it does not copy/install these header-files (needed by PECL PDO-drivers later) from its source directory to php's ext/pdo directory.
 [2005-09-10 15:35 UTC] wez@php.net
Sounds like a gentoo bug ;-)
I can't repeat this if you use the PHP supported approach:

pear install pdo
pear install pdo_XXX
 [2005-09-11 12:38 UTC] akorthaus at web dot de
Wez, have you ensured that your $PHP_INCLUE_DIR/ext/pdo directory used by pear/php-config is empty (from old install, or --with-pdo...)? 

I noticed the problem while testing the PECL packages for Gentoo. 

I build PHP and PDO completely (manually) from source in my home directory, and I'm not the only one having this problem.

That's what I did:

export PHP_PREFIX="/home/akorthaus/bin/php-5.1.0RC1"
rm -r $PHP_PREFIX
cd ~/src

rm -r php-5.1.0RC1
tar -xjf php-5.1.0RC1.tar.bz2
cd php-5.1.0RC1
./configure --prefix=$PHP_PREFIX --disable-all
make && make install && make install-cli
cd ..

tar -xzf PDO-1.0RC1.tgz
cd PDO-1.0RC1
$PHP_PREFIX/bin/phpize
./configure --with-php-config=$PHP_PREFIX/bin/php-config
make && make install
cd ..

tar -xzf PDO_sqlite-1.0RC1.tgz
cd PDO_SQLITE-1.0RC1
$PHP_PREFIX/bin/phpize
./configure --with-php-config=$PHP_PREFIX/bin/php-config

And HERE I get an error:

checking for PDO includes... checking for PDO includes...
configure: error: Cannot find php_pdo_driver.h.


If I check this:

$ ls $PHP_PREFIX/include/php/ext
date  standard

There is no PDO directory. For the Gentoo ebuild we have to create that directory, and copy the 3 header-files created in PDO src directory here.

I also canot find a line in http://cvs.php.net/co.php/pecl/pdo/config.m4 - where this should be done from PECL-PDO package itself.

PHP - if configured --without-pdo - does not ship with the needed header PDO Header files, so where should PECL-PDO-SQLITE... get them from?
 [2005-09-11 15:13 UTC] akorthaus at web dot de
probably PHP_INSTALL_HEADERS is not defined?
But why?

config.m4:

  ifdef([PHP_INSTALL_HEADERS],
  [
    PHP_INSTALL_HEADERS(ext/pdo, [php_pdo.h php_pdo_driver.h])
  ], [
    PHP_ADD_MAKEFILE_FRAGMENT
  ])
 [2005-09-11 15:15 UTC] wez@php.net
Makefile.frag defines install-pdo-headers target and a hack that should cause it to run alongside the install.
I'll see if there's a better way.
 [2005-09-11 15:45 UTC] wez@php.net
Fixed on 5.1 branch.
Will push a PECL release either today or tomorrow.
 [2005-09-12 05:54 UTC] akorthaus at web dot de
Your fix works for me, thanks a lot wez!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Mar 10 21:01:30 2025 UTC