Can someone help me understand why this is returning false?
if ((move_uploaded_file($_FILES[$field][\'tmp_name\'], $path))) {
As in, potent
I was facing the same problem.
If your error says "Failed to open stream: Permission Denied" it means the PHP Server is not being capable of creating the new file inside your destination directory.
Once you have set the Linux permissions on the directory (wich sounds like you did by making it 777) you should give that special permission to the PHP Server.
If your folder is named "uploads", you should cd to the previous directory and use the next command:
chcon -R -t httpd_sys_rw_content_t uploads
That definetly solved my problem.
Hope it helps.