Home » PEAR » PEAR » Bug #7217
go-pear.php web installation problem
Details
| Submitted | 2006-03-27 14:28 UTC |
|---|---|
| From | rebe at unit01 dot net |
| Assigned | pajoye |
| Status | Closed |
| Package | PEAR |
| PHP Version | 5.1.2 |
| OS | linux |
| Roadmaps | (Not assigned) |
Comments
[2006-03-27 14:28 UTC] rebe at unit01 dot net
Description:
------------
Latest go-pear:
$Id: go-pear,v 1.81 2006/03/11 14:15:20 pajoye Exp $
fails on php5 with "open_basedir" restriction.
Function tmp_dir() about line 1156 has check code:
$_temp = my_env('TMPDIR');
if (!$_temp) {
if (is_writable('/tmp')) {
$_temp = '/tmp';
}
}
which fails cause is_writable('/tmp') return true (!!) even if php
cannot write anything there because of restrictions, so then in line
423:
$ptmp = tempnam($foo, 'gope');
$ptmp becomes ampty - script is downloading packages into current dir
which makes then conflicts and errors.
I suggest to change this:
if (!$_temp) {
if (is_writable('/tmp')) {
$_temp = '/tmp';
}
}
to something like that:
if (!$_temp) {
$test = '/tmp/'.uniqid();
if (@mkdir($test)) {
@rmdir($test);
$_temp = '/tmp';
}
}
which forces to create something to check if its possible.
[2006-03-27 15:06 UTC] rebe at unit01 dot net
/tmp is writable but not for that webpage due to open_basedir restriction. I know it looks like php bug and so i just reported it to them too. But so far till php will be corrected go-pear.php script is useless in that case.
My problem is i restricted php (open_basedir) and shell at all for web hosting issues and i can't recommend any working sollution to easy install pear on users pages.
[2006-03-28 08:58 UTC] rebe at unit01 dot net
I am specifying php setting upload_tmp_dir to every virtual host but there is no TMPDIR env in my whole linux box. I checked everywhere (tried shell envs and phpinfo and i didn't find any env telling what is a temp dir except upload_tmp_dir for php)
So, frankly i don't know what for you're checking that env in your script cause i am afraid is empty in most systems.
[2006-03-28 09:13 UTC] rebe at unit01 dot net
I am using mostly Debian (and clones) and Trustix distros but i expect that every linux is the same in this case.
Yes that is good idea to add that setting in config and for sure check if its no current dir because installation fails when try to download pear packages again for main pear (Archive and so on..) and print error downloading because they exists.