Knowledgebase

Understanding File Permissions for Developers Print

  • developersgitdeployment, developers, permissions, uploads, caching, cpanel, restore, security, woocommerce, errors
  • 0

Getting them right so applications work and stay secure.

THE STANDARD VALUES

  • Directories: 755
  • Files: 644
  • Configuration holding credentials: 600
  • Executable scripts: 755

NEVER 777

It allows any process on the server to modify the file. Our configuration will frequently refuse to execute such files anyway. Documentation telling you to use it is wrong.

SETTING THEM IN BULK

Use find to apply directory and file permissions separately, rather than applying one value recursively to everything. Applying 755 to every file makes them all executable, which is wrong.

OWNERSHIP

On shared hosting, files should be owned by your cPanel user. Files owned by another user cause permission errors that look like configuration problems.

If ownership is wrong after a restore or an upload by an unusual method, open a ticket and we will correct it.

WRITABLE DIRECTORIES

Applications need write access to specific directories: uploads, cache, storage. Those need 755 with correct ownership, not 777.

DIAGNOSING

A 403 on a directory, uploads failing, or an application unable to write its cache are all permission symptoms.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot