Actions

Difference between revisions of "Cannot save Global Configuration changes"

From Joomla! Documentation

Line 1: Line 1:
[[Category:FAQ]]
+
== Cannot save Global Configuration changes ==
 
+
=== The problem: ===
{{cookiejar}}
+
After entering the Global Configuration area on the site administrative “back-end” and then clicking on either the “Save” or “Apply” button to save the current choice of site configuration, the following error message appears:
{{stub}}
+
“An Error has occurred! Unable to open configuration.php file to write!”, possibly accompanied by:
This problem is usually caused by incorrect ownership or permissions on the ''configuration.php'' file which is where the Global Configuration settings are stored. On some Joomla! installations the ''configuration.php'' file is set to read-only as an additional security measure.
+
“JFTP::write: Bad response”
 
+
if you are working in FTP enabled mode.
'''Solution:'''
+
=== Reason for this Error: ===
 
+
The configuration update script in Joomla! has been unable to change the contents of the file “configuration.php” to reflect any changes you made on the Global Configuration page. Joomla! has either been unable to write to the file and/or unable to make the file writeable (i.e. R/W). Since Joomla! 1.5.x attempts to make “configuration.php” writeable before saving the configuration, the latter is more usually the case.
In order to bypass this problem and save your configuration changes you will have to have access (ftp or ssh) to the webserver hosting your joomla site and change the permissions of the ''configuration.php'' file. Usually most hosting providers permissions scheme, comes in the form: owner(ftp_username), group (webserver username), others (word readable). If that's the case, then use your ftp client to give write access to the group of the file. If you use an cli terminal, you can go to the root path of the joomla site and execute the following command:
+
The most common reason for this is that the file “configuration.php” is owned by a different logical user to the one trying to make the change.  If you are trying to change Global Configuration with FTP enabled, the latter will usually be your FTP login ID; with FTP disabled it will be a web server process identity (often named as something like “apache” or “www-data”).
 
+
(You can usually check on file ownership details by logging in to your site with an FTP programme. Alternatively you could use eXtplorer – see below).
<nowiki>#chmod 660 configuration.php</nowiki>
+
Unfortunately, you will be locked out of changing to the appropriate mode to update the Global Configuration as the enabling and disabling of FTP mode (and thus changing the logical identity attempting to change the configuration) is determined by the Global Configuration data held in that file.
 
+
=== Suggested solutions: ===
'''!!Note!! As mentioned above this a potential security risk, so if you complete the changes, you should change to permissions 640 which is rw-r----.'''
+
'''NOTE:''' it is not sufficient to just make the “configuration.php” file writeable as you will be able to update the Global Configuration just once, after which Joomla! 1.5.x will make the file read-only for all users once more and reintroduce the problem.
 +
# Change the ownership of the “configuration.php” file to match either your FTP login ID if using “FTP enabled” for the site, or the web server process identity if you are using “FTP disabled”. <br />'''NOTE:''' This is not something that you can do within Joomla!.<br />If you have total control of the server (e.g. local server or viryual server) then you should be able to do this using an appropriate utility (such as “chown” for a Linux server). On a shared server, you should contact the technical support for your organisation or your ISP, explain the problem, and ask them change the file ownership appropriately.
 +
# Install the eXtplorer component (Joomla! Extensions Directory – [http://extensions.joomla.org/extensions/2630/details]) – if not already in place. This will allow you to view and manipulate files in both “file” mode (using the web server process user identity) or “ftp” mode using your FTP login user identity.  Although you will probably not be able to change the file ownership with this tool, you can use one of the modes to make “configuration.php” writeable for all users. This will enable you to change to the Global Configuration once – or more if you include in that a change to the FTP mode so that it matches the ownership of your “configuration.php” file (but see Note below).
 +
'''NOTE:''' changing the FTP mode will affect the ownership applied to files uploaded to the site under the new setting (e.g. when installing extensions).
 +
=== Background: ===
 +
The above is a simplified explanation, but the following may be of interest and value to all, and also help expert users formulate their own solution to this problem.
 +
* The file “configuration.php” is generated automatically in the site’s root folder (from “configuration.php-dist”) during site installation and incorporates in it the site-specific information given during the install process. Changes made in the Global Configuration area in the site's administrative “back-end” are written to “configuration.php” when the either the “Save” or “Apply” button is used.
 +
* Whenever Joomla! attempts to update “configuration.php” file, it first attempts to make it is writeable and – after updating the file – then make it unwriteable (i.e. read-only), as a security precaution.
 +
* Files on the web server hosting your Joomla! site will be owned by one of several entities, depending on how they were placed or created on the server. Generally files on a Joomla! site will be owned by either of two user identities:
 +
*# files you upload by FTP or installed with FTP mode active will generally be allocated ownership of a user ID corresponding to your FTP login ID for that site,
 +
*# files installed from within Joomla! and with FTP mode inactive will generally be allocated ownership by the “phantom”  user ID that used to run the main web server processes as well as your Joomla! scripts (often named as something like “apache” or “www-data”).

Revision as of 13:50, 26 June 2009

Contents

Cannot save Global Configuration changes

The problem:

After entering the Global Configuration area on the site administrative “back-end” and then clicking on either the “Save” or “Apply” button to save the current choice of site configuration, the following error message appears: “An Error has occurred! Unable to open configuration.php file to write!”, possibly accompanied by: “JFTP::write: Bad response” if you are working in FTP enabled mode.

Reason for this Error:

The configuration update script in Joomla! has been unable to change the contents of the file “configuration.php” to reflect any changes you made on the Global Configuration page. Joomla! has either been unable to write to the file and/or unable to make the file writeable (i.e. R/W). Since Joomla! 1.5.x attempts to make “configuration.php” writeable before saving the configuration, the latter is more usually the case. The most common reason for this is that the file “configuration.php” is owned by a different logical user to the one trying to make the change. If you are trying to change Global Configuration with FTP enabled, the latter will usually be your FTP login ID; with FTP disabled it will be a web server process identity (often named as something like “apache” or “www-data”). (You can usually check on file ownership details by logging in to your site with an FTP programme. Alternatively you could use eXtplorer – see below). Unfortunately, you will be locked out of changing to the appropriate mode to update the Global Configuration as the enabling and disabling of FTP mode (and thus changing the logical identity attempting to change the configuration) is determined by the Global Configuration data held in that file.

Suggested solutions:

NOTE: it is not sufficient to just make the “configuration.php” file writeable as you will be able to update the Global Configuration just once, after which Joomla! 1.5.x will make the file read-only for all users once more and reintroduce the problem.

  1. Change the ownership of the “configuration.php” file to match either your FTP login ID if using “FTP enabled” for the site, or the web server process identity if you are using “FTP disabled”.
    NOTE: This is not something that you can do within Joomla!.
    If you have total control of the server (e.g. local server or viryual server) then you should be able to do this using an appropriate utility (such as “chown” for a Linux server). On a shared server, you should contact the technical support for your organisation or your ISP, explain the problem, and ask them change the file ownership appropriately.
  2. Install the eXtplorer component (Joomla! Extensions Directory – [1]) – if not already in place. This will allow you to view and manipulate files in both “file” mode (using the web server process user identity) or “ftp” mode using your FTP login user identity. Although you will probably not be able to change the file ownership with this tool, you can use one of the modes to make “configuration.php” writeable for all users. This will enable you to change to the Global Configuration once – or more if you include in that a change to the FTP mode so that it matches the ownership of your “configuration.php” file (but see Note below).

NOTE: changing the FTP mode will affect the ownership applied to files uploaded to the site under the new setting (e.g. when installing extensions).

Background:

The above is a simplified explanation, but the following may be of interest and value to all, and also help expert users formulate their own solution to this problem.

  • The file “configuration.php” is generated automatically in the site’s root folder (from “configuration.php-dist”) during site installation and incorporates in it the site-specific information given during the install process. Changes made in the Global Configuration area in the site's administrative “back-end” are written to “configuration.php” when the either the “Save” or “Apply” button is used.
  • Whenever Joomla! attempts to update “configuration.php” file, it first attempts to make it is writeable and – after updating the file – then make it unwriteable (i.e. read-only), as a security precaution.
  • Files on the web server hosting your Joomla! site will be owned by one of several entities, depending on how they were placed or created on the server. Generally files on a Joomla! site will be owned by either of two user identities:
    1. files you upload by FTP or installed with FTP mode active will generally be allocated ownership of a user ID corresponding to your FTP login ID for that site,
    2. files installed from within Joomla! and with FTP mode inactive will generally be allocated ownership by the “phantom” user ID that used to run the main web server processes as well as your Joomla! scripts (often named as something like “apache” or “www-data”).