FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18666&edit=1

ID: 18666
Updated by: ifeghali@php.net
Reported By: kalessin at kalessin dot fr
Summary: PEAR doesn't honor the ext_dir configuration variable
Status: Open
Type: Bug
Package: PEAR
Operating System: Irrelevant
Package Version: SVN
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

confirmed on 1.9.4. looks like PEAR doesn't use ext_dir for anything.


Previous Comments:
------------------------------------------------------------------------

[2011-07-13 23:36:59] kalessin14

Added #patch
bug:18666;patch:honor_ext_dir_configuration_var.patch;revision:1310596619;.

------------------------------------------------------------------------

[2011-07-13 20:28:47] kalessin14

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


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
%

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Sep 18, 2011 at 7:32 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18666&edit=1

    ID: 18666
    Updated by: daniel.oconnor@gmail.com
    Reported By: kalessin at kalessin dot fr
    Summary: PEAR doesn't honor the ext_dir configuration variable
    Status: Open
    Type: Bug
    Package: PEAR
    Operating System: Irrelevant
    Package Version: SVN
    PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: dufuz
    Roadmap Versions:
    New Comment:

    -Assigned To:
    +Assigned To: dufuz
    Thanks for the patch Louis, it looks good at a cursory glance.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-05 19:49:55] ifeghali

    confirmed on 1.9.4. looks like PEAR doesn't use ext_dir for anything.

    ------------------------------------------------------------------------

    [2011-07-13 23:36:59] kalessin14

    Added #patch
    bug:18666;patch:honor_ext_dir_configuration_var.patch;revision:1310596619;.

    ------------------------------------------------------------------------

    [2011-07-13 20:28:47] kalessin14

    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


    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
    %

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 5, '11 at 5:49p
activeSep 18, '11 at 7:32a
posts2
users2
websitepear.php.net

2 users in discussion

Daniel Oconnor: 1 post Ifeghali: 1 post

People

Translate

site design / logo © 2021 Grokbase