Feb 2, 2010
I am experiencing a umask problem with a PHP script that is managing image/file uploads. The resulting uploaded file has unix permissions of 600 and is therefore not readable by apache.
I have checked the umask in
and both are set to 0022 - which should give me 644 permissions.

server default umask is set to 0022.
php5 handler is set to suPHP so is Apache setting the incorrect umask on these files?
If I use file manager or ftp to upload files i get the expected 644 permissions (umask 0022). There is no umask or chmod function in the PHP file upload script.

Going slightly bonkers trying to find an answer.

cPanel 11.25.0-R42404
WHM 11.25.0 - X 3.9
CENTOS 5.4 i686


Well-Known Member
Jun 18, 2004
cPanel Access Level
DataCenter Provider
Even with 0600, a webserver with SuPHP enabled should be able to read the file since PHP will run as the user that owns the file (assuming that is the case, which it should be if uploaded through PHP). I have a feeling you don't have SuPHP enabled and therefore files are being uploaded owned by 'nobody'.

Double check Main >> Service Configuration >> Apache Configuration >> PHP and SuExec Configuration and make sure suphp is selected as the default handler.