From:             
Operating system: Irrelevant
PHP version:      Irrelevant
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:PEAR doesn't honor the ext_dir configuration variable

Description:
------------
I'm using PEAR 1.9.0, but newer version are also affected.

PEAR doesn't honor the ext_dir configuration variable, or I didn't
understand how to use it.

The ext_dir configuration variable is supposed to be used when you want to
install extensions in a custom directory. This is useful to allow
unprivileged user to install php extensions in their home directories.

To make the ext_dir configuration variable working I fixed the build
function in Builder.php to use ext_dir as a prefix for the destination path
of the extension. I also fixed the enableExtension function in
Command/Install.php to write the full path to the extension in php.ini when
ext_dir is set.

While these fixes fit my use case they are not perfect because they use
ext_dir as a prefix instead as the full dirname for the extension. Moreover
I didn't take care of possible regressions and some other places in the
code certainly need to be adjusted (e.g: error messages).

The attached patch applies to SVN r313186

Best regards

PS: It's not clear where this bug should be reported, the PEAR website
doesn't seem to have the concept of bugs in PEAR itself but only in
packages…


Test script:
---------------
#!/bin/sh

ext_dir=`mktemp -d`

pear config-set ext_dir $ext_dir user
pecl install mongo

rm -rf $ext_dir


Expected result:
----------------
[...]
Build process completed successfully
Installing '/tmp/tmp.km7ZJACEQ3/lib/php5/20090626/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=/tmp/tmp.km7ZJACEQ3/lib/php5/20090626/mongo.so"
to php.ini
%

Actual result:
--------------
[...]
Build process completed successfully
Installing '/usr/lib/php5/20090626/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
%

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55196&edit=1
-- 
Try a snapshot (PHP 5.2):            
https://bugs.php.net/fix.php?id=55196&r=trysnapshot52
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55196&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55196&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55196&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55196&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55196&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55196&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55196&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55196&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55196&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55196&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55196&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55196&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55196&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55196&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55196&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55196&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55196&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55196&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55196&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55196&r=mysqlcfg
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55196&r=trysnapshot54

Reply via email to