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).
I have changed permissions to 444 and configuration.php is still writable. Why?
I would like to protect it from hacking.
Hi Chris,
It might be that your Joomla directory is located elsewhere and you’re changing the wrong configuration file. Try to rename your configuration file to something like configuration.temp.php and see if your site stops working. Most like it won’t.
[…] this is not the first time where we’re unable to save the global configuration, but this time it was different. It had nothing to do with file permissions, as the […]
Somehow global configuration must relate do some database entries, because it depends on what database I am using whether global configuration can be saved or not. I found this out that way:
I installed a completely new and fresh joomla version on a different server and imported that database into a second database of my first joomla installation where I could not save any global configuration anymore. After switching the database in configuration.php of the first site, it was possible to save global configuration as usual! Changing back to troubled database, it was not able anymore.
By the way: changing permissions of configuration.php to 644 did not work! Cannot save anything though in global configuration.
There is another aspect that I found out: changing database, does change permissions! After switching database to the second one, configuration.php permissions were set to 444! Switching again to first one, permissions were set to 644.
So can you tell me, what table of database is responsible for permission settings?
Hi Websquirrel,
The configuration.php’s permissions are never related to the database – otherwise there would be no way to salvage a website if the database is corrupted (e.g. the website cannot switch to another database).
It seems that since you have moved to another server, Apache (and, in turn, Joomla) no longer has write access to the configuration.php and no longer owns the configuration.php file.
Try changing the permissions on the configuration.php to 666 and see if that works – if it doesn’t, then please contact us.