Tuesday, November 18, 2008

PHP: move_uploaded_file, Permission denied

If you ever receive the failed to open stream: Permission denied error in Linux on the move_uploaded_file function, try changing the upload folder's permissions through the chmod command:
chmod 0777 upload_dir


Unknown said...

Thanks a lot, it works!! :)

Unknown said...

Don't! This is a potential security risk. Giving read, write, and execute permissions to everyone is opening yourself to a bunch of vulnerabilities.

The right way is to give www-data the right permissions.