Reputation: 1
After installing SuPHP & SuExec on debian squeeze server, I've got error with file upload permissions...
The file is moved correctly in the good folder after upload, but the permission of the file is 640 and I want to set automatically a 755 file permission...
Apache don't show image or file uploaded, and return "permission denied" error... It's the same with an extension or file uploaded with a CMS like drupal, Joomla, etc... I can't install them...
Anyone has idea ..? Thank's in advance
Upvotes: 0
Views: 1118
Reputation: 2198
This is because of the umask parameter in suphp.conf, this parameter sets the permissions that files created by a PHP script will get:
;Umask to set, specify in octal notation
;umask=0077
umask=0022
This is my suphp.conf, with umask 0077
my files were created with 600 permissions. But with 0022
they are created with 644.
If your files are created with 640 permissions I am guessing that your umask is 0027, you need to change this to 0022.
Some more examples of umask vs. permissions can be found here: http://www.webune.com/forums/umask-calculator.html
Upvotes: 1