Start a conversation

How to set the rights to files and folders?

To ensure the safe operation of sites, the servers use SuPHP technology, due to which PHP does not work as an Apache web server module, but as a standalone decryptor.

The system determines the location of the executable PHP script and executes it not on behalf of "Nobody" (unknown), but exclusively on behalf of the user.

This allows in the event of a site's hacking attempt to avoid the possibility during the attack to receive access to the other subdirectories, protecting other hosting users and, in fact, the server itself from executing unwanted commands.

In this regard, there are special requirements for permissions (CHMOD) on files and folders. The server will not respond to a request to a file if its rights are higher than 644 and will not allow access to the folder if rights higher than 755 are set on it.

If you do not need to constantly change the file, it is recommended that you set 444 permissions on it that prohibit writing to the file.

If the file can be dynamically changed, set 644 permissions on it. Regarding folders, it is recommended to use 755 permissions - this will allow not only reading the files located in the folder, but also writing to it, as previously with 777 permissions.

If the rights to the file are set to 664, 646 or 666, the web server will refuse to respond to requests to this file and will display an error page.

The same goes for folders with permissions of 775, 757 or 777.

In such cases usually the 500 Internal Server Error is displayed.

Choose files or drag and drop files
Was this article helpful?
  1. Oleksii Momot

  2. Posted
  3. Updated