Remove 'Config file still writable' warning on Windows

on 04-Mar-2010 | Comments ( 6 ) Tags: Evolution

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:

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
 
Doug
Posts: 4
Comment
Re: Remove 'Config file still writable' warning on Windows
Reply #6 on : Tue March 30, 2010, 10:46:10
In a word...Brilliant.

Thanks
David Bunker
Posts: 4
Comment
Re: Remove 'Config file still writable' warning on Windows
Reply #5 on : Wed May 05, 2010, 17:48:51
Some FTP Programs have Shell or Raw Commands that can be sent to a server. site ReadOnly config.inc.php should set it to 444. I found on a Mac, Yummy didn't work but Cyberduck did!
cipa
Posts: 2
Comment
Re: Remove 'Config file still writable' warning on Windows
Reply #4 on : Wed May 05, 2010, 17:59:25
Interesting, I'll try it tomorrow

Thank you.
cipa
Posts: 2
Comment
Re: Remove 'Config file still writable' warning on Windows
Reply #3 on : Tue June 08, 2010, 08:19:23
I found out that my server doesn't accept chmod anymore and the cyberduck solution didn't work. I'll have to investigate my server setup and see what's happening
Pablo Liz
Posts: 4
Comment
Re: Remove 'Config file still writable' warning on Windows
Reply #2 on : Mon February 28, 2011, 08:22:44
Ir worked like a charm. Thanks a lot. Was having some trouble with this little friend. Thanks a lot.
Vlax
Posts: 4
Comment
Thxs!
Reply #1 on : Wed May 18, 2011, 03:52:15
It worked beautifully!

Quick modx Evolution Tags

  • cached [[snippet]] or uncached [!snippet!]
  • {{chunk}}
  • [+placeholder+]
  • [*resourceField/TV*]
  • [^timing^]
  • [~link~]

Quick modx Revolution Tags

  • [[snippet]]
  • [[$chunk]]
  • [[+placeholder]]
  • [[*resourceField/TV]]
  • [[~link]]
  • [^timing^]
  • [[++systemSetting]]
  • [[%languageStringKey]]
  • all tags can be called un-cached like: [[! snippet]]

Timing Tags (Evo and Revo)

  • [^qt^] - Query time
  • [^q^] - Query count
  • [^p^] - Parse time
  • [^t^] - Total time
  • [^s^] - Source
© modxRULES! 2009-2014