|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31486 Compiled pear in php5 cgi uses php4 headers
Submitted: 2005-01-11 04:58 UTC Modified: 2005-01-12 16:41 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tim dot lokot at printsoft dot com Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: 5.0.2 OS: Redhat
Private report: No CVE-ID: None
 [2005-01-11 04:58 UTC] tim dot lokot at printsoft dot com
I've been trying to test PHP5 on my PHP4 webserver and ended up running PHP5 as a CGI with PHP4 as an Apache module.  PHP4 was installed via RPM.

I used this command to configure PHP5:

'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr/include/mysql/' '--with-config-file-path=/usr/local/lib/php5' '--includedir=/usr/local/php5/include' '--oldincludedir=/usr/local/php5/include'

PHP5 seems to run fine until I try to add any extensions to it from PECL.  Then the pear executable tells me that it has the wrong API in it.  So now whenever it tries to install any PECL modules, I get API errors when PHP tries to load them.

From what I can tell I'm either (hopefully) missing a configure option, or the pear compile is finding the php4 headers by default and using them instead of the php5 ones.

Actual result:
The php5 pear executable returns this:

Configuring for:
PHP Api Version:   20020918
Zend Module Api No:   20020429
Zend Extension Api No:   20021010

phpinfo() returns this:

PHP API  20031224
PHP Extension  20040412
Zend Extension  220040412


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-11 16:28 UTC]
You try to run with wrong phpize. Use the one you installed in the /usr/local/php5/bin 

 [2005-01-11 22:47 UTC] tim dot lokot at printsoft dot com
The commands I ran (in order) were:

cd /usr/local/php5/bin
./pear install pdflib

When I run "./pear show-config" I get these settings below.  To me it looks like everything is in the correct place.

PEAR executables directory     bin_dir         /usr/local/php5/bin
PEAR documentation directory   doc_dir         /usr/local/php5/lib/php/doc
PHP extension directory        ext_dir         /usr/local/php5/lib/php/extensions
PEAR directory                 php_dir         /usr/local/php5/lib/php
PEAR Installer cache directory cache_dir       /tmp/pear/cache
PEAR data directory            data_dir        /usr/local/php5/lib/php/data
PHP CLI/CGI binary             php_bin         /usr/local/php5/bin/php
PEAR test directory            test_dir        /usr/local/php5/lib/php/test
Cache TimeToLive               cache_ttl       3600
Preferred Package State        preferred_state stable
Unix file mask                 umask           22
Debug Log Level                verbose         1
HTTP Proxy Server Address      http_proxy      <not set>
PEAR server                    master_server
PEAR password (for             password        <not set>
Signature Handling Program     sig_bin         /usr/bin/gpg
Signature Key Directory        sig_keydir      /usr/local/php5/etc/pearkeys
Signature Key Id               sig_keyid       <not set>
Package Signature Type         sig_type        gpg
PEAR username (for             username        <not set>

The only thing I can think of is that when I type in phpize or pear from any other directory (without specifically running the php5 version) it runs the php4 versions as the directory must be set in the environment path.

So how do I get pear to specifically run the version in the php5 bin directory rather than the version it finds in the environment path?

Thanks for the pointer to phpize though.
 [2005-01-11 23:28 UTC] tim dot lokot at printsoft dot com
To anyone that has similar issues, the workaround using phpize is as follows (its not well documented for custom installs ) ...

$ cd [phpbindir]
$ ./pear download [extname]
$ gzip -d < [extname].tgz | tar -xvf -
$ cd [extname]
$ ../phpize
$ ./configure --with-php-config=[phpbindir]/php-config
$ make
$ cd .libs
$ mv [extname].so [phpextdir]

This works when the default "./pear install [extname]" does not
 [2005-01-12 16:41 UTC]
You could also change the PATH variable, I'm doing this 
# PATH=/path/to/second/php/bin:$PATH pear install foo 
But no Bug -> Bogus 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 19:01:28 2024 UTC