Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.13

Bug #6559 pear should ignore safemode/open_basedir
Submitted: 2006-01-23 16:27 UTC
From: jdolecek at netbsd dot org Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 5.1.1 OS: NetBSD
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 28 - 3 = ?

 [2006-01-23 16:27 UTC] jdolecek at netbsd dot org
Description: ------------ 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 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 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:// 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


 [2006-01-23 16:27 UTC] cellog
using -n is not an option. Clearly none of your users has tried to install Image_Color, which depends on the gd extension. However, we can add a disabling of safe_mode and open_basedir on the command-line which will fix this.
 [2006-01-23 16:28 UTC] cellog
This is moved from PHP bug 35544 (
 [2006-01-23 16:30 UTC] cellog
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2006-01-28 19:57 UTC] jdolecek at NetBSD dot org
BTW, it would be cool if the close description would include exact way this has been fixed and reference to specific file and revision of the CVS commit of the fix. Thanks for fixing it, tho I don't have any way to figure out the change besides checking all CVS logs.