When I want upload an image on my server, my script doesn't have the rights for write this file.
However, my script is execute localy and the rights of the folder are 0775.
...# chmod -R 0775 img
drwxrwxr-x 2 root root 4096 Jun 11 10:56 img
The upload directory needs to be owned by the user that will write the file (in this case the user the web server process is running under) or the upload directory needs to have group ownership for a group of which the web server process user is a member.
So for example if the webserver user is apache and the web server user is a member of group apache, you could solve this by
chown apache /path/to/upload/directory
chgrp apache /path/to/upload/directory
Any script running on the webserver will then have write access to the upload directory.