From: jdolecek at netbsd dot org Operating system: NetBSD PHP version: 5.1.1 PHP Bug Type: Feature/Change Request Bug description: pear should ignore safemode/open_basedir
Description: ------------ If user sets safemode or open_basedir restriction in their php.ini, they will no longer be able to use pear upgrade etc - the pear call will end with error. NetBSD pkgsrc patches pear.sh to use -n to ignore system php.ini, i.e to exec: exec $PHP -C -q $INCARG -d output_buffering=1 \ -n $INCDIR/pearcmd.php This works as long as pear doesn't need any non-builtin extensions or include path different to the one compiled into the executable. FWIW, we had no problem reports about this causing any problem since the change was introduced (2004/12/12), so this appears to work fine for all NetBSD pkgsrc users. Rather then using -n and ignoring system php.ini completely, it would be great if CLI PHP either ignored the open_basedir/safemode setting implicitely or had a commandline flag to do so (which then would be used in pear.sh/pear.bat). Reproduce code: --------------- Edit php.ini, set open_basedir to /nonexistent. Then run any pear upgrade from commandline: > pear upgrade HTML_Common Expected result: ---------------- downloading HTML_Common-1.2.2.tar ... Starting to download HTML_Common-1.2.2.tar (-1 bytes) ........done: 20,992 bytes upgrade ok: channel://pear.php.net/HTML_Common-1.2.2 Actual result: -------------- Warning: require_once(PEAR.php): failed to open stream: Operation not permitted in pearcmd.php on line 63 PHP Fatal error: require_once(): Failed opening required 'PEAR.php' (include_path='/usr/pkg/lib/php') in /usr/pkg/lib/php/pearcmd.php on line 63 -- Edit bug report at http://bugs.php.net/?id=35544&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35544&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35544&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35544&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35544&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35544&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35544&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35544&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35544&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35544&r=support Expected behavior: http://bugs.php.net/fix.php?id=35544&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35544&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35544&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35544&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35544&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35544&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35544&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35544&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35544&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35544&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35544&r=mysqlcfg