Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Umask file upload problem

Discussion in 'General Discussion' started by rwhitehead, Feb 2, 2010.

  1. rwhitehead

    rwhitehead Registered

    Feb 2, 2010
    Likes Received:
    Trophy Points:
    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
  2. garrettp

    garrettp Well-Known Member PartnerNOC

    Jun 18, 2004
    Likes Received:
    Trophy Points:
    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice