You think that it’s time to enable caching, or you think that you want to rewrite your URLs, or you want to take your website temporarily offline, so you just change the configuration settings in your Joomla website, you click on Save on the top right, and you are greeted by the following error:
An Error has occurred! Unable to open configuration.php file to write!
Instead of seeing this success message:
The Global Configuration details have been updated.
You try it again, and again, and again… But you always see the same error message, where Joomla complains that it’s not able to write to the configuration file. So, why are you seeing this error, and how do you fix it?
Why are you seeing this error?
The global configuration settings of your Joomla website are saved to a file, and not to the database (it is not possible to save the global configuration information to the database, as this information consists of – among others – the connection parameters to the database, so you need this information before connecting to the database). This global configuration file is called configuration.php and is located under the root directory of your Joomla website. When you try to update your configurations settings, Joomla opens this file in writing mode, and writes your new information to it. So, if Joomla is unable to write to this file, then you will see this error (by the way, when you see this error it means that your new settings did not take effect). But what are the reasons that prevent Joomla from writing to the configuration.php file?
In our experience, there are two reasons:
- The permissions on your configuration.php are only set to read (for example 444/-r–r–r–) for all groups.
- There are some filesystem/server related issues that are preventing write activities. For example, the server hard disk is write-protected.
Of course, the most common reason for this problem is the first one…
How do you fix the problem
The first thing to do is to check the permissions on your configuration.php file (again, the file is located under the root directory of your website, so it’s most likely under public_html or public_html/yourdomainname.com). You can check the permissions by connecting through FTP to your website, and then right clicking on the configuration.php, and then seeing what the permissions are (note: the process of checking the permissions varies greatly from one FTP client to the other). Now, if you see something such as 444 or -r–r–r– (note that non-writable permissions can be something else), this means that the permissions on your configuration file only allow the file to be read by all groups. The best thing to do in this case is to change the permissions for the configuration.php file to 666 or to -rw-rw-rw-1 2. Instructions on how to do so vary from one FTP client to the other, but they should be straightforward. Now login to your Joomla’s control panel using a super administrator account, and try changing some configuration settings and click on “Save” at the top right and see if it works for you3. If it doesn’t, the move to the next step…
Now if you’re still reading, then it means that your Joomla still can’t write the settings to the configuration.php file4, and it’s most likely not a permission issue. So the best thing to do in this situation is to contact the website host and tell them that your website is unable to write to the configuration.php file and they’ll fix it for you.
If you think that you still need help, then that’s why we’re here! Just contact us and we’ll take care of this problem in no time. And don’t worry, our fees are very competitive. Oh, and we’re very friendly!
1If you’re unable to change the permissions on your configuration.php file, then it means you’re not allowed to by your web host. Check with them on how to address this problem.
2If the original permissions are anything other than 666, then change them to 666 and see if Joomla is able to save you configuration settings.
3Once you’re done, it is advisable to change the permissions of your configuration.php file to 444, regardless of the original permissions.
4In some very rare cases where Joomla is unable to write its settings to the global configuration file, the reason can be that someone changed your status from a super administrator to something lower (just when you tried to save the configuration settings), and only super administrators can update the Joomla configuration. If this is the case, however, you will most likely see a different error from Joomla (not the one stating that it’s unable to write to the configuration file).