PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file
| From: | Robert Mena | Date: | Fri, 04 Jul 2003 15:00:21 +0000 |
| Subject: | PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153998@lists.php.net to get a copy of this message | ||
Hi,
I am faciing a strange problem. I have some php
script to receive images (via file upload).
The script is failling to work because it can't
move/copy the file.
I've added a sleep(x) in order to make the temporary
file stick around.
20 -rw------- 1 apache apache 19402 Jul 4
10:49 /tmp/phpFj6Irk
I've added apache to an upload group
upload:x:1098:apache
And changed the owner of the directory.
ls -sla /home/httpd/html/foo.com/img/news/
total 24
4 drwxrwxr-x 6 webmaste upload 4096 Jul 4
10:11 .
4 drwxrwxr-x 5 webmaste webmaste 4096 Jun 10
15:55 ..
4 drwxrwxr-x 2 webmaste upload 4096 Jun 4
09:41 1
4 drwxrwxr-x 2 webmaste upload 4096 Jul 4
10:48 10
4 drwxrwxr-x 2 webmaste upload 4096 Jul 4
09:54 2
And the both commands below fail.
move_uploaded_file($tmpfile,$destination)
exec("/bin/cp $tmpfile $destination",$array)
The var_dump in array shows
array(0) { }
The $destination var has (checked with echo)
/home/httpd/html/foo.com/img/news/10/xxx.jpg
Any ideias ?
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com