Page 1 of 1

php: pear upgrade pear fails

PostPosted: 16. November 2005 04:26
by spas
Hi,

I noticed that XAMPP 1.5.0 and XAMPP 1.5.0 pl1 both have a problem with the PHP pear command.

Attempting to run `pear upgrade pear` fails with:

Code: Select all
downloading PEAR-1.4.4.tgz ...
Starting to download PEAR-1.4.4.tgz (276,978 bytes)
.........................................................done: 276,978 bytes
permission denied (delete): \xampp\php\pear.bat
permission denied (delete): \xampp\php\peardev.bat
permission denied (delete): \xampp\php\pecl.bat
ERROR: commit failed


This is resolved by removing the ATTRIB +R command for the three files listed.

The pear.bat included in pear-1.4.4 has not mention of ATTRIB commands.

Thanks,
Scott

PostPosted: 16. November 2005 10:10
by Wiedmann
permission denied (delete): \xampp\php\pear.bat
permission denied (delete): \xampp\php\peardev.bat
permission denied (delete): \xampp\php\pecl.bat

That is no Problem. Just make the Upgrade with "-f" (force) and you have a working PEAR 1.4.4.

This is resolved by removing the ATTRIB +R command for the three files listed.

Not a good idea. I use special batchfiles for the XAMPP environment. And with the read-only flag I make sure that an upgrade not not override the batchfiles from XAMPP...

PostPosted: 08. December 2005 11:45
by rushy2uk
I have had a similar problem when trying to run 'pear upgrade -a Services_Ebay-alpha' but found this advice here http://www.symfony-project.com/trac/wik ... format=txt :
Code: Select all
C:\xampp>pear upgrade PEAR
downloading PEAR-1.4.4.tgz ...
Starting to download PEAR-1.4.4.tgz (276,978 bytes)
.........................................................done: 276,978 bytes
permission denied (delete): \xampp\php\pear.bat
permission denied (delete): \xampp\php\peardev.bat
permission denied (delete): \xampp\php\pecl.bat
ERROR: commit failed
}}}

Found the problem after a little research.  Open `c:\xampp\php\pear.bat` in notepad. 
Near the middle of the file you will see several lines like this:

ATTRIB +R %PHP_PEAR_BIN_DIR%\pear.bat >nul
ATTRIB +R %PHP_PEAR_BIN_DIR%\peardev.bat >nul
ATTRIB +R %PHP_PEAR_BIN_DIR%\pecl.bat >nul

Put a REM in front of all three commands, save the file and then run the `pear upgrade pear` again.  It should work now.


I have added 'REM' to the lines under the :INSTALLED section of the pear.bat file like so:
Code: Select all
REM ATTRIB +R %PHP_PEAR_BIN_DIR%\pear.bat >nul
REM ATTRIB +R %PHP_PEAR_BIN_DIR%\peardev.bat >nul
REM ATTRIB +R %PHP_PEAR_BIN_DIR%\pecl.bat >nul

Is this okay to do or will this lead to problems in the future?