Remove 'Config file still writable' warning on Windows
In order to get rid of the 'Config file still writable' warning when you login into the manger, we have to set the config.inc.php to be read only. In *nix environments this is easily achieved by changing the file permission using your favorite ftp program. Windows is different as the file permission is not accessible through the ftp program (or I could not find one).
The solution will make use of chmod command that will be run by executing a php file.
Create the file
Navigate to /manager/includes and create a new php file named permission.php. Paste the code bellow into your new file:
<?php
$result = chmod("config.inc.php",0444); //set read-only flag
//$result = chmod("config.inc.php",0777); //remove read-only flag
if($result){
echo "It worked!";
}else{
echo "An error has occurred!";
}
?>
Run it
Open your browser and navigate to http://www.YOUR-SITE.com/manager/includes/permission.php
If the output is "It worked!" then you successfully changed the permission of the file. Otherwise you might have a strange setup and I recommend asking on the modx forums
Notes:
- use 0444 to set the read-only flag on Windows. Nothing else will work.
- use 0777 to remove the read-only flag on Windows.
- the file can also sit in your root folder but you have to make sure that the path to the config file is correct.
Write a comment
Posts: 2
Reply #4 on : Tue March 30, 2010, 11:46:10
Posts: 2
Reply #3 on : Wed May 05, 2010, 18:48:51
Posts: 2
Reply #2 on : Wed May 05, 2010, 18:59:25
Posts: 2
Reply #1 on : Tue June 08, 2010, 09:19:23