We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19090
    • 35 Posts
    Hi for those facing this error, it seems to be a problem in the php function is_writable http://ch.php.net/is_writable
    The solution is to edit "manager/includes/config_check.inc.php" and add the following code at the end:

    function is__writable($path) {
    //will work in despite of Windows ACLs bug
    //NOTE: use a trailing slash for folders!!!
    //see http://bugs.php.net/bug.php?id=27609
    //see http://bugs.php.net/bug.php?id=30931
    
        if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
            return is__writable($path.uniqid(mt_rand()).'.tmp');
        else if (is_dir($path))
            return is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
        // check tmp file for read/write capabilities
        $rm = file_exists($path);
        $f = @fopen($path, 'a');
        if ($f===false)
            return false;
        fclose($f);
        if (!$rm)
            unlink($path);
        return true;
    }
    


    Then change the following line on the beginning of the file:

    if (is__writable("includes/config.inc.php")) 


    note the added underscore in is_writable

    That will solve all your headaches!

    Regards

    Vlax
      • 37550 ☆ A M B ☆
      • 711 Posts
      This looks like a pretty neat fix, I was actually reading up on this the other day as we currently set the file to read only in windows although due to how IIS security is setup the file is always read only to the public anyway.

      I will give this a go on a test server later but from looking at it, perhaps the MODx team can add this into a later release.

      Thanks Aaron
        http://www.onesmarthost.co.uk
        UK MODX Hosting with love.
        • 12335
        • 1 Posts

        I use php to set the permissions on this file.

        Dump this php code in a php file, I called mine chmod.php
        <?php
        chmod("manager/includes/config.inc.php", 0444);
        ?> 
        


        At the root of the webserver (IIS) c:\inetpub\wwwroot
        and browse it with a web browser -> http://website/chmod.php

        Has worked for me 100% of the time, we generally use Win2k3 32bit, mysql 5.0.x and IIS 6.0 php 5.2.5 & 5.3.0 and that fastcgi c_r_a_p.