php - Unable to write file with 0775 -


when want upload image on server, script doesn't have rights write file.

however, script execute localy , rights of folder 0775.

...# chmod -r 0775 img drwxrwxr-x 2 root root 4096 jun 11 10:56 img 

but, when put rights in 0777, it's work. there has solution not allowing write directory ?

thanks !

the upload directory needs owned user write file (in case user web server process running under) or upload directory needs have group ownership group of web server process user member.

so example if webserver user apache , web server user member of group apache, solve by

chown apache /path/to/upload/directory 

or

chgrp apache /path/to/upload/directory 

any script running on webserver have write access upload directory.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -