Skip to content

Fix file permissions

If your PHP or WordPress app is having problems creating or modifying files and directories, the problem is likely incorrect file ownership.

All of your app’s files should be owned by the app’s system user.

Most file permissions problems are caused by creating or uploading files and directories while logged into the server as the user root over SSH or SFTP. As PHP runs as an app’s system user, the app’s PHP scripts can’t write to those files or directories.

Fix file and directory ownership

To set the correct owner for all files and directories of an app, log into the server as root and run the following command. Replace SYSUSER with the name of the system user.

Terminal window
sudo chown -R SYSUSER:SYSUSER /srv/users/SYSUSER/apps/APPNAME