How to make system files (.htaccess, wp-config.php) writeable

There are some cases where server-side settings interfere with WP Rocket's automatic configuration, and a message about missing writing permissions can appear after you activated or deactivated the plugin. 

The message can relate to your wp-config.php file:

WP Rocket cannot configure itself due to missing writing permissions.

missing permissions on wp config

Or, you can find a message about your .htaccess file:

WP Rocket could not modify the .htaccess file due to missing writing permissions.

missing permissions on htaccess

Or when deactivating the plugin:

WP Rocket has not been deactivated due to missing writing permissions.

missing permissions on deactivation

This document gives you an overview of possible ways to troubleshoot issues with file permissions.

Please note that contacting your web host about this type of issue may be required in certain cases.

1. Check security plugin settings

Plugins such as  iThemes Security and similar ones may be protecting system files such as wp-config.php and .htaccess from being edited. Make sure that’s not the case! For details please, see this article:
Using iThemes Security with WP Rocket

Once WP Rocket is up and running, you can continue to protect wp-config.php. However, .htaccess and other files and folders should remain writable for WP Rocket, since their content might need to change according to your settings.

2. File permission settings

Once you’re sure it’s not a security plugin interfering, check whether file permissions are set properly on the server. Follow these steps:

Connect to your server via (S)FTP.
Find the .htaccess and/or wp-config.php files. They are located in the root folder of your WordPress installation. In rare cases, wp-config.php can be located even one level above your WordPress root folder.
Depending on your FTP client, you should be able to right-click (or ctrl+click) on a file name and select an option like  “Get Info”, or “File permissions..”, or “File attributes” from the context menu. Clicking that option should display some file info, including permissions.
WP Rocket requires a standard setup according to WordPress rules for files/folders permission. Make sure files are set to 640 or 644, and folders are set to 750 or 755:

FTP client panel with file info windows, permissions set to 644

Heads up! On some hosting platforms, the permissions need to be different because the user running the webserver doesn’t have permission to write files. You can try with other values, such as 664, 666 for files, and 775 (even 777 for some hosting platforms). Make sure to consult with your hosting provider about this. We strongly advise against 777 permission settings. 

3. Ownership settings

If none of the above solves the issue for you, it could be caused by file ownership settings. In this case, contacting your hosting provider for further support is your best bet.

4. Using ACL (Access Control Lists)

Instead of opening recursive read, write and execution rights for everyone, you can use ACL to grant these permission levels only to the user running the processes. For example, www-data is the typical Apache process user. This is an advanced configuration, so please check with your hosting provider about this.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.