php.net |  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
Votes:1
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tim dot lokot at printsoft dot com
New email:
PHP Version: OS:

 

 [2005-01-11 04:58 UTC] tim dot lokot at printsoft dot com
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-11 16:28 UTC] sniper@php.net
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.

Configuration:
==============
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.php.net
PEAR password (for             password        <not set>
maintainers)
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>
maintainers)


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 http://www.php.net/manual/en/install.pecl.phpize.php ) ...

$ 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] johannes@php.net
You could also change the PATH variable, I'm doing this 
like 
 
# 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: Wed May 08 21:01:33 2024 UTC