PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Warning: stat failed for <root path>/upload/50cd23f1ec7bed66799da314534f8992 (errno=13 - Permission denied) in <root path>/admin on line 2356 Warning: MkDir failed (Permission denied) in <root path>/admin on line 2356 Warning: Unable to create
I've tried to set the upload directory to public read/write, and it seems to stick to that. Is there a common cause for this problem (which is probably the most likely situation?)
Remember that all PHP scripts run as "nobody" on Unix servers (i.e. as good as "anonymous - the lowliest of low") - so approach the permission denied error from this perspective to get around it, not from YOUR perspective.
I mean that your PHP script runs as "nobody" - this is a default user account which has virtually no user/group rights to do anything on the server - least of all set a chmod of 770 which is trying to set full rwx for users/groups (of which it isn't a member).
User 'nobody' will not have the appropriate permissions, as launchcode
has said. You will have to create upload directories under an account
with appropriate permissions, like your account.
Set the dir to 0777 so 'nobody' can upload.
Depending on the purpose of
the script you can also run command line version of the script under your account manually or with crontab.
Thanks for the help - I've solved it now. I've also set the Public attributes to 'execute' (giving an 0706 CHMOD). This has now worked, otherwise I wouldn't have been able to access the upload directory.