Changing Pecl installation directory

muffin picture muffin · Oct 27, 2014 · Viewed 13.4k times · Source

Hi i'm having trouble with pecl installation, the problem i'm having is i'm installing gearman , and i'm now at the stage of installation of the pecl PHP extension.

it should be a simple as executing the command :

$ sudo pecl install gearman

the installation was successfull and I could even test a php containing

<?php
echo "Gearman version: " . gearman_version() . PHP_EOL;
?>

executing it in CLI php using :

$ php gearman_version.php

does the trick. Unfortunately I am using a stack. lappstack to be precise, and I have a separate php in the installation of my lappstack which is in :

/home/userName/lappstack-5.4.34-0/php

where php/etc contains my php.ini for web use.

now, going back to the pecl installation of gearman, executing the pecl install gearman results to gearman being installed in a separate php5 installation, and the gearman.so is installed in :

/usr/lib/php5/20121212/gearman.so

which, ideally, the gearman.so should be contained in :

/home/userName/lappstack-5.4.34-0/php/lib/php/extensions/gearman.so

like all my other extensions.

which actually results to the application not being able to use the gearman extension. And the php.ini that is being pointed to, to use gearman is actually the ones in :

/etc/php5/cli

and

/etc/php5/apache2

I need help, I'm really in the process of getting haywired in my installations. Thanks !

Answer

cweiske picture cweiske · Feb 20, 2015

You can see the configured directories with

$ pear config-show

To change the directories, e.g. php_dir, use config-set:

$ pear config-set php_dir /path/to/foo