PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #5798

PEAR include_path problem

Details

Submitted2005-10-27 18:49 UTC
Frommurley at townnews dot com
StatusBogus
PackagePEAR
PHP Version5.1.0
OSANY
Roadmaps(Not assigned)

Comments

[2005-10-27 18:49 UTC] murley at townnews dot com

Description:
------------
$pear_package_version = "1.3.5";

In the bin/pear file line 15 allows you to set an enviorment variable that pear will use as the lib/php dir.

# then look for the right pear include dir
if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
INCDIR=$PHP_PEAR_INSTALL_DIR
INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"

At the last line line 32 you call bin/php with the include dir and execute pearcmd.php - This works and actually will pass the exported lib dir to PHP. The problem lies in pearcmd.php on line 28:

if ('/usr/local/lib/php' != '@'.'include_path'.'@') {
ini_set('include_path', '/usr/local/lib/php');
}

This if loops forces an overwrite of the included_path passed at command line to PHP in bin/pear causing include_path to have the incorrect path and thus pear fails at line 42 when tring to require PEAR.php.

Test script:
---------------
export PHP_PEAR_PHP_BIN=/var/tmp/php-5.1.0RC1-build/usr/local/bin/php

export PHP_PEAR_INSTALL_DIR=/var/tmp/php-5.1.0RC1-build/usr/local/lib/php

/var/tmp/php-5.1.0RC1-build/usr/local/bin/pear config-show

Expected result:
----------------
Configuration:
==============
PEAR executables directory bin_dir /var/tmp/php-5.1.0RC1-build/usr/local/bin
PEAR documentation directory doc_dir /usr/local/lib/php/docs
PHP extension directory ext_dir /usr/local/lib/php/extensions/no-debug-non-zts-20050617
PEAR directory php_dir /var/tmp/php-5.1.0RC1-build/usr/local/lib/php
PEAR Installer cache directory cache_dir /tmp/pear/cache
PEAR data directory data_dir /usr/local/lib/php/data
PHP CLI/CGI binary php_bin /var/tmp/php-5.1.0RC1-build/usr/local/bin/php
PEAR test directory test_dir /usr/local/lib/php/tests
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 2
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/etc/pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)

Actual result:
--------------
Warning: main(PEAR.php): failed to open stream: No such file or directory in Config.php on line 21

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='/usr/local/lib/php') in /var/tmp/php-5.1.0RC1-build/usr/local/lib/php/PEAR/Config.php on line 21