Koozali.org: home of the SME Server

Problems with PHP file uploads.

Steen Loecke

Problems with PHP file uploads.
« on: January 18, 2003, 12:40:15 PM »
Hi Friends...

First sorry for my english, but I hope you understand what my issue is :)

I have a similar problem as descibed in this thread:

http://forums.contribs.org/index.php?topic=5774.msg20441#msg20441

and I followed the advise and do the job as described in the FAQ-link (I also remember to reboot); but my script (upload.php) gives me this line in /var/log/message:
"Jan 18 09:53:18 moornook httpd: PHP Warning: open_basedir restriction in effect. File is in wrong directory in /home/e-smith/files/ibays/anbay/html/annews/newsadmin/upload.php on line 111"

In line 111 in upload.php I have this:
copy($userfile, $dirname."/".$filename) or die("Error: could not copy file.");

Now comes the tricky part :)

If I edit my php.ini and insert this:
upload_tmp_dir=/home/e-smith/files/ibays/anbay/html

..then my upload-script works fine; but it is not a solution for my SME-server (ver. 5.5 update1) because then file upload only works for that specific ibay, and I have severals virtualdomains. No, I want it should work for all my domians. So here comes my question: How do I do that??? Is there a workaround? I hope :))

Best regards
Steen Loecke

Steen Loecke

Re: Problems with PHP file uploads.
« Reply #1 on: January 18, 2003, 04:25:45 PM »
Hi :))

Now it works! I use this commands as root:

/sbin/e-smith/db accounts setprop my_i-bay_name PHPBaseDir /    
/sbin/e-smith/signal-event ibay-modify my_i-bay_name

The reason why it did't work in first place was a slip of the pen :-/

Cheers
Steen Loecke