Brinkster Knowledge Base
Zencart Read/Write for configure.php Files
configure.php file is writeable. It looks like this:
Warning: I am able to write to the configuration file: C:\sites\SERVER\USERNAME\webroot\zencart\includes\configure.php.
This is a potential security risk - please set the right user permissions on this file (read-only, CHMOD 644 or 444 are typical).
You may need to use your webhost control panel/file-manager to change the permissions effectively. Contact your webhost
for assistance.
For Linux Servers:
Customers can use SSH to set permissions to the file themselves. You would use the CHMOD 664 command to correct the warning.
For Windows Servers:
For Windows servers, it's a little different. ZenCart is testing the 'write'-access of the config files through the use of a php
function 'Is_writeable'. This function does not return the correct value on windows servers, as it is looking at the 'read-only'
flag of the file, not checking the file rights of the caller.
While setting the files to 'read-only' will simulate a fix, the better solution is to edit the source code to disable this check
entirely. This is actually very easy. Take the following steps:
1. Navigate to the /zencart/includes/init_includes/ folder.
2. Open the init_header.php file and find the following line.
define('WARN_CONFIG_WRITEABLE', 'true');
|
3. Change this line to the following.
define('WARN_CONFIG_WRITEABLE', 'false');
|
4. Do the same for the /zencart/admin/includes/init_includes/init_header.php file.
After doing these steps, you should no longer see that message.