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

Bug #13167 go-pear fails to install under open_basedir with no temp. directory
Submitted: 2008-02-21 14:21 UTC
From: ts Assigned: tias
Status: Closed Package: pearweb_gopear (version 1.1.1)
PHP Version: 5.2.5 OS: Linux
Roadmaps: (Not assigned)    

 [2008-02-21 14:21 UTC] ts (Tom Sommer)
Description: ------------ go-pear fails to locate a decent tmp. directory. It tries to use /tmp, but that directory is not always accessible, safe-mode will usually prevent access. The installer should try and use the $PREFIX/tmp directory as well, and create it if needed. Actual result: -------------- SAFE MODE Restriction in effect. The script whose uid is X is not allowed to access /tmp owned by uid 0 $PREFIX/temp/System.php on line 459


 [2008-03-01 16:15 UTC] tias (Tias Guns)
Hello Tom, Interestingly, such code seems to be already present in go-pear. Something must be going wrong, but I don't know where. I've added some basic 'print' statements that report on what the script does when searching for a temp dir, could you please run this file and report me what it returns ? (I've also added an extra is_writable test, but I doubt that that will fix it) You can get the test go-pear from: Thank you, Tias
 [2008-03-03 08:45 UTC] ts (Tom Sommer)
It seems to bail out of the function here: Line ~1260: $fh = @fopen(realpath($default) . "/test","wb"); if ($fh) { return true; $default having the workable path ($prefix/temp), so it must revert to /tmp later in the script, or simply not save the working path.
 [2008-03-06 22:17 UTC] cos (Ofer Inbar)
I just reported a bug at, that may be related:
 [2008-03-07 08:13 UTC] ts (Tom Sommer)
I doubt it's related, this bug appears to be the installer simply not using the desired temp directory, but instead using /tmp for certain operations.
 [2008-03-07 19:39 UTC] cos (Ofer Inbar)
Why does that make you doubt it's related? My bug is caused by pear using the system's /tmp/pear/cache during the build, instead of a temporary directory only for the build. It certainly seems like it could be related. I don't know enough about PHP's build process to be sure, so if you know why it's not related and can explain I'd appreciate that.
 [2008-05-20 20:33 UTC] tias (Tias Guns)
Ofer, its not related because the bug you describe does not use go-pear. Tom, your analysis is correct, it must revert somewhere later. In fact it seems that go-pear itself was quite succesful, since it installed the error you encounter is in $PREFIX/temp/System.php I've added some lines that desperately try to fix the found tempdir to any variable that might be used later on, I hope this works. I've upload this test go-pear again to: I hope this fixes it, please let me know if it does. Greetings, Tias
 [2008-05-30 07:01 UTC] ts (Tom Sommer)
The installation completed without issues, using the last patch.
 [2008-06-14 14:19 UTC] mw (Marcel Wiechmann)
Had the same problem here and with the fix the installer had no problem at all. But the bug is still present in created index.php file. Warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (*) in /var/www/virtual/ on line 459 If you add "putenv("TMPDIR=whereeveryouwant");" in the index.php you can bypass the error. But i don't think that this is a solution. The easy way would be that the installer use upload_tmp_dir but i'm not sure if this is impure cause i'm not a programmer or somethins similar.
 [2008-07-31 11:49 UTC] ts (Tom Sommer)
Any chance we can get this patch added?
 [2008-08-02 16:22 UTC] tias (Tias Guns)
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. Hi, I finally found the time to set up an open_basedir test environment. Yes, the fixes in go_pear.php and in PEAR_Frontend_Web will be added and released (reasonably soon). The origin of the annoying behaviour is actually in PEAR, and it should be fixed there too (see bugs #14391 and #14437) Thanks for reporting the bugs, Tias