How to change the default umask for Apache/PHP

The Apache/PHP umask determines the permission of newly created files on the server. To change the umask you need root access, which is only available on Dedicated hosting plans without Geeky features and a Performance Booster.

To change the umask, you should open the following file:

and inside it, add the following line:

The above will set the default permissions to 022. For the change to take effect you have to restart the Apache service on the server.

You need help managing your dedicated server? We got it! SiteGround experts not only write helpful articles, but also manage the servers for our clients so they don’t have to read articles like this one. Learn more.