The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Umask file upload problem

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

  1. rwhitehead

    rwhitehead Registered

    Joined:
    Feb 2, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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
    /home/cpeasyapache/src/suphp.conf
    /opt/suphp/etc/suphp.conf
    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

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
Loading...

Share This Page