PHP 5.0.5 and PEAR 1.4.2...together?

From: Date: Wed, 19 Oct 2005 21:57:05 +0000
Subject: PHP 5.0.5 and PEAR 1.4.2...together?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21550@lists.php.net to get a copy of this message
Hello, This is an odd question, and I'm not sure if I'm posting it to the right list. It has to do with the PEAR and PEAR modules that comes with PHP 5.0.5 (i.e. the pear/ directory). I was recompiling PHP 5.0.5 today and remembered that the PEAR that came with 5.0.5 was an older version. So, since I wanted PEAR 1.4.2, I decided I would try to put PEAR 1.4.2 in place of the original PEAR as well as replace the other PEAR modules with newer versions while I was at it. I was met with mixed results. I was able to install all the new PEAR modules except the actual PEAR 1.4.2. This was relatively easy. First, I gunzip'd all the "new" modules in pear/packages and replaced the old tar files (HTML_Template_IT, Net_UserAgent_Detect, XML_RPC). Second, I untar'd the new Archive_Tar into pear/, renamed the package.xml to package-Archive_Tar.xml, and modified the file paths such that they matched the old Archive_Tar (i.e. pear/Archive/Tar.php). This is the point where I'm having problems, which I think have to do with the new version of PEAR. If I stop modifying at this point and do a "make install", then I don't have any troubles and, like magic, I now have all new versions of the PEAR modules I'm supposed to (but the actual PEAR module is still the old version). The problem comes if I upgrade PEAR before the "make install". To "upgrade" PEAR, I untar the PEAR 1.4.2 package in pear/, move the package.xml to package-PEAR.xml, and then move all the contents of the untar'd directory down to pear/ (to match the directory structure). When I do this, "make install" now gives me errors as follows: Warning: Invalid argument supplied for foreach() in /usr/src/RPM/BUILD/php-5.0.5/pear/PEAR/Installer.php on line 999 Fatal error: Call to a member function getChannel() on a non-object in /usr/src/RPM/BUILD/php-5.0.5/pear/PEAR/Installer.php on line 1030 I believe this is a problem with PEAR, but I don't know enough about it to know for sure. I can fix these errors by modifying install-pear.php as follows: --- install-pear.php 2005-10-19 17:46:26.000000000 -0400 +++ install-pear.php.new 2005-10-19 17:46:14.000000000 -0400 @@ -107,6 +107,7 @@ } } else { $options['nodeps'] = true; + $options['force'] = true; $err = $installer->install($instfile, $options); if (PEAR::isError($err)) { $ui->outputData(sprintf("[PEAR] %s: %s", $package, $err->getMessage())); Now, the install will continue, but the registry files are written to /usr/lib/php/.registry, which seems correct, but I have set the INSTALL_ROOT to point to my temporary directory so I can build an RPM. I do this as follows: export INSTALL_ROOT=/tmp/php-buildroot make INSTALL_ROOT=/tmp/php-buildroot install When I do this with the old version of PEAR it works fine and writes the registry files without fail to /tmp/php-buildroot/usr/lib/php/.registry/. However, when using the new version of PEAR, it continues to write it to /usr/lib/php/.registry even with INSTALL_ROOT set. This is the basis of the problem I'm having (writing the registry files). I am at a loss as to why this is happening, so I decided to write this disgustingly long e-mail to the list to plead for help. I know this is a non-standard way of doing things, but I think in doing so I may have stumbled upon a PEAR bug. I could be wrong, but I thought it was worth a shot. Any help would be greatly appreciated. Thanks.

« previous php.pear.general (#21550) next »