I have a PHP script that receives uploads and it works fine in mamp, creating directories and receiving files as necessary, but when I move it to the server it errors out sa
The script must be able to write to the parent directory in order to create sub directories, so chmod 777 the parent directory, for instance httpdocs/uploads/ or wherever you are storing these files.
chown or chmod 777 the directories where the script wants to write (create) the files and NOT the script itself.
chmod("/somedir/somefile", 0777);