php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55196 PEAR doesn't honor the ext_dir configuration variable
Submitted: 2011-07-12 22:55 UTC Modified: 2011-07-13 17:30 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: kalessin at kalessin dot fr Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: Irrelevant OS: Irrelevant
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: kalessin at kalessin dot fr
New email:
PHP Version: OS:

 

 [2011-07-12 22:55 UTC] kalessin at kalessin dot fr
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
%

Patches

pear_honor_the_ext_dir_configuration_variable.patch (last revision 2011-07-13 02:55 UTC by kalessin at kalessin dot fr)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-13 02:21 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-07-13 02:21 UTC] pajoye@php.net
Please report this bug here:

http://pear.php.net/pear
 [2011-07-13 04:38 UTC] till@php.net
It's bogus anyway.

It's not supposed to suggest that.

You'll have to set extension_dir in your php.ini so an extension is found and can 
be loaded. The complete path is never added to extension=foo.so.
 [2011-07-13 14:47 UTC] kalessin at kalessin dot fr
Setting extension_dir will not erase the "system" extension directory? I'm saying that because extension_dir is not a search path.

I'm waiting for a confirmation e-mail to submit the bug to PEAR. It's not really clear if any kind of registration is required or if it works like here.
 [2011-07-13 17:30 UTC] kalessin at kalessin dot fr
This bug has been submitted again in the right bug tracker:

http://pear.php.net/bugs/bug.php?id=18666
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC