FAQ
Edit report at https://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: Assigned
+Status: Closed
Type: Bug
Package: PEAR
Operating System: Irrelevant
Package Version: SVN
PHP Version: Irrelevant
-Assigned To: dufuz
+Assigned To: doconnor
Roadmap Versions:
New Comment:

-Status: Assigned
+Status: Closed
-Assigned To: dufuz
+Assigned To: doconnor
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.




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

[2011-09-18 09:33:05] doconnor

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

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

[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
%

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

Search Discussions

  • Kalessin at Dec 10, 2011 at 2:48 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=18666&edit=1

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

    Thank you for taking care of it!

    Do you mind pointing out the changeset(s) that fixes it?

    Best regards


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

    [2011-12-10 11:56:59] doconnor

    -Status: Assigned
    +Status: Closed
    -Assigned To: dufuz
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

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

    [2011-09-18 09:33:05] doconnor

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

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

    [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
    %

    ------------------------------------------------------------------------
  • Daniel Oconnor at Dec 11, 2011 at 1:14 am
    Edit report at https://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: Closed
    Type: Bug
    Package: PEAR
    Operating System: Irrelevant
    Package Version: SVN
    PHP Version: Irrelevant
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    https://github.com/pear/pear-core/pull/2


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

    [2011-12-10 15:48:29] kalessin14

    Thank you for taking care of it!

    Do you mind pointing out the changeset(s) that fixes it?

    Best regards

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

    [2011-12-10 11:56:59] doconnor

    -Status: Assigned
    +Status: Closed
    -Assigned To: dufuz
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

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

    [2011-09-18 09:33:05] doconnor

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

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

    [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;.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18666

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 10, '11 at 10:57a
activeDec 11, '11 at 1:14a
posts3
users2
websitepear.php.net

2 users in discussion

Daniel Oconnor: 2 posts Kalessin: 1 post

People

Translate

site design / logo © 2021 Grokbase