The user that PHP is running as on your server does not have permission to use chmod
. Consequently, you don't have permission to write to the file. You should probably not use chmod
in your script anyway, and it seems your host does not allow it.
Rather, you should ensure that the folder you are attempting to upload to AND the folder that files upload to temporarily have the permissions you show above (0755).