If you’ve been following these posts, we now have a lovely git push to deploy setup, and can ssh into our server without constantly needing to enter our password through the use of ssh keys.
However, if you’re running on cPanel, you will probably have bumped into this error:
SoftException in Application.cpp:256: File "/home/username/public_html/index.php" is writeable by group
This is clearly a permissions error, and so the obvious thought is to chmod it. However, we don’t want to ssh in and chmod every time we push! On the testing server, the permissions are fine, but they are different once the git push has done its post-update.
The reason for this is something to do with a thing called umask. Umask is a user mask which is created for processes that are performing tasks, and affects new files and folders.
The solution to this is to edit ~/.bash_profile, and insert the following command:
From now on you shouldn’t have the problem. With newly created files.
To sort already existing files, Chmod -R 755 any folders affected, OR just log out and in, and git pull or git reset –hard HEAD^ in order to re-fetch the files. This time they should be created without any strange permission errors!