Question
Permission denied
Hi All,
In my test server environment (on my MAC), I have created an upload_test
folder in my Sites folder, one in my website root folder, and one in my
Home folder, but every time I attempt to upload an image to any, I get
an error like the one below:
Warning:
move_uploaded_file(/Users/brett/upload_test/Toyota_Corolla_91.jpg)
[function.move-uploaded-file]: failed to open stream: Permission denied
in /Users/brett/vhosts/test10/upload04.php on line 6
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/private/var/tmp/phpYorkEc' to
'/Users/brett/upload_test/Toyota_Corolla_91.jpg' in
/Users/brett/vhosts/test10/upload04.php on line 6
I'm on a MAC running PHP 5.2.4, MySQL 5.0.24, I'm using Apache 1.3.41
which was pre-installed on my G5. The PHP/MySQL is a build from Marc
Liyanage which I installed from instructions in PHP for DW8. Everything
up until now has worked fine, but then I've never tried to upload using
PHP until now. This issue seems to be a Permission problem and, try as I
have, I cannot seem to get the correct permission to upload. In looking
at the Apache section in phpinfo() I see this:
Hostname:Port localhost:80
User/Group www(70)/70
and it makes me wonder if I don't have permission because I'm not logged
in as user www? I log in as brett and I am the administrator so why is
Apache setting www as the User. If that is the problem, how do I get
Apache to have me as the user?
TIA for any help.
In my test server environment (on my MAC), I have created an upload_test
folder in my Sites folder, one in my website root folder, and one in my
Home folder, but every time I attempt to upload an image to any, I get
an error like the one below:
Warning:
move_uploaded_file(/Users/brett/upload_test/Toyota_Corolla_91.jpg)
[function.move-uploaded-file]: failed to open stream: Permission denied
in /Users/brett/vhosts/test10/upload04.php on line 6
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/private/var/tmp/phpYorkEc' to
'/Users/brett/upload_test/Toyota_Corolla_91.jpg' in
/Users/brett/vhosts/test10/upload04.php on line 6
I'm on a MAC running PHP 5.2.4, MySQL 5.0.24, I'm using Apache 1.3.41
which was pre-installed on my G5. The PHP/MySQL is a build from Marc
Liyanage which I installed from instructions in PHP for DW8. Everything
up until now has worked fine, but then I've never tried to upload using
PHP until now. This issue seems to be a Permission problem and, try as I
have, I cannot seem to get the correct permission to upload. In looking
at the Apache section in phpinfo() I see this:
Hostname:Port localhost:80
User/Group www(70)/70
and it makes me wonder if I don't have permission because I'm not logged
in as user www? I log in as brett and I am the administrator so why is
Apache setting www as the User. If that is the problem, how do I get
Apache to have me as the user?
TIA for any help.