|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2002-10-13 18:25 UTC] michael dot mauch at gmx dot de
 Trying to install PHP into a directory other than /usr/local results in a broken PEAR install, because the --prefix directory is not honoured: Installing PHP SAPI module Installing shared extensions: /house/elmicha/spe142/lib/php/extensions/no-debug-non-zts-20020429/ Installing PHP CLI binary: /house/elmicha/spe142/bin/ Installing PEAR environment: /house/elmicha/spe142/lib/php/ Warning: mkdir(/usr/local/lib/php) [http://www.php.net/function.mkdir]: Permission denied in /house/elmicha/local/src/php-4.3.0pre1/pear/System.php on line 236 Warning: mkdir(/usr/local/lib/php/.registry) [http://www.php.net/function.mkdir]: No such file or directory in /house/elmicha/local/src/php-4.3.0pre1/pear/System.php on line 236 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
I have the same problem, when building an RPM of PHP, the case I have is that I will in the end install it below a /app/... structure only when building an RPM it will be placed below /tmp/... When buildning the RPM I don't want write access to the /app/... I found a problem with the install-pear.php and PEAR_Installer(). When the PEAR_Installer is initializing it creates some directories based on php_dir variable, only we are once the init is done replace it with $reg_dir, which can be php_dir, or install_root and php_dir. The patch below will set the php_dir to $reg_dir while it initializes the put back the original value, fast and ugly workaround ;-) I did it on php-4.3.0, checked the code in php-4.3.0RC4 didn't see anything that it should be solved. --- php-4.3.0/pear/install-pear.php~ Fri Dec 13 03:14:22 2002 +++ php-4.3.0/pear/install-pear.php Tue Jan 7 15:27:31 2003 @@ -61,7 +61,11 @@ $reg = &new PEAR_Registry($reg_dir); $ui = &new PEAR_Frontend_CLI(); + +$old_php_dir = $config->get('php_dir'); +$config->set('php_dir', $reg_dir); $installer = &new PEAR_Installer($ui); +$config->set('php_dir', $old_php_dir); $installer->registry = &$reg; foreach ($install_files as $package => $instfile) {