What Permissions Should PHP Scripts Have?

Correct permissions on PHP scripts are necessary for normal operation on hosting. They are the main protection of the system against unauthorized access to important files.
Permissions are set separately for each file and are written as a three-digit number. The first digit is the access level of the file's owner, the second is the access level of the owner's group, and the third is the access level for everyone else.
644 – the default permissions set by the server for both HTML and PHP files. Here 6 means the right to read and edit the file (4+2), 4 – read, 4 – read.
The most common modes are listed below:
- 400 (-r--------) - the owner can read, and nobody else has any rights, including editing;
- 644 (rw-r--r-) - any user can read, and the owner can edit;
- 660 (-rw-rw----) - the owner and the group can read and edit, and everyone else has no rights at all;
- 664 (rw-rw-r-) - every user can read, and the owner and the group can edit;
- 666 (rw-rw-rw) - any user can read and edit;
- 700 (-rwx------) - only the owner can read, write and execute; all other users have no access;
- 744 (rwxr--r-) - all users can read, and the owner can edit and execute;
- 755 (-rwxr-xr-x) - all users can read and execute, and the owner can edit;
- 777 (-rwxrwxrwx) - any user can read, edit and execute.
UkrHost provides all the services needed to create and run your website at the highest level. Our team of specialists is always ready to answer all your questions. You can ask them on our website or by calling one of the numbers listed in the Contacts section.