Discussion:
[PHP-INSTALL] upload_tmp_dir and open_basedir
JM
2008-06-12 12:23:39 UTC
Permalink
/home on my machine is a symlink to /local/home.

In PHP 5.2.0: when I set upload_tmp_dir to /home and open_basedir to
either /local/home or /home then performing a file upload fails.
In PHP 5.2.6 this seems corrected.
Which bug was that?

On another note, while I was reading the docs about open_basedir I was
wondering: it says 'all symlinks are resolved', but what happens when
the argument to open_basedir itself is a symlink (like in my case)? I
suppose it is resolved too?
So in the previous example, whether I use /local/home or /home or any
combination thereof, all of them are resolved to /local/home in the end?
Right?

TIA
Mark
j***@redcross-transfusion.be
2008-06-13 06:24:59 UTC
Permalink
Check that the user under wich apache runs have writing permission for the
upload directory, remember to use move_uploaded_file function after, or ur
uploaded file might disapear in the end of your php script

Jerôme Kaluza
Service du Sang
Service Informatique
Croix-Rouge de Belgique
rue de Stalle 96 - 5e étage
B-1180 Bruxelles
Tél. : + 32 (0)2 371 35 27
Fax : + 32 (0)2 371 35 23
***@redcross-transfusion.be
http://www.transfusion.be

P.S.: Le temps de lire ce mail, 1 personne aura eu besoin d?une
transfusion en Belgique pour survivre. Alors, n'oublions pas : une vie est
irremplaçable, pas le sang ! Plus d'infos, sur http://www.transfusion.be.



JM <lists+***@roth.lu>
12/06/2008 15:15

A
php-***@lists.php.net
cc

Objet
[PHP-INSTALL] upload_tmp_dir and open_basedir






/home on my machine is a symlink to /local/home.

In PHP 5.2.0: when I set upload_tmp_dir to /home and open_basedir to
either /local/home or /home then performing a file upload fails.
In PHP 5.2.6 this seems corrected.
Which bug was that?

On another note, while I was reading the docs about open_basedir I was
wondering: it says 'all symlinks are resolved', but what happens when
the argument to open_basedir itself is a symlink (like in my case)? I
suppose it is resolved too?
So in the previous example, whether I use /local/home or /home or any
combination thereof, all of them are resolved to /local/home in the end?
Right?

TIA
Mark
JM
2008-06-13 12:26:32 UTC
Permalink
Post by j***@redcross-transfusion.be
Check that the user under wich apache runs have writing permission for
the upload directory, remember to use move_uploaded_file function
after, or ur uploaded file might disapear in the end of your php script
No no no,..
everything is alright, believe me. PHP is running as fastcgi and
permissions are correct.
move_uploaded_file *will* fail because the php20945gfioj tmp file is not
there in the first place.
Strangely, I can stat() it, an blocks and block size will return -1.

As I said all seems to work with latest PHP, but I still would like to
know where the culprit was.

Loading...