Hi once again. One more question.
It is also said in the manual: "Before running setup, make sure your core/cache/ and core/config/ directories are writable by PHP". The key words that surprise me are "by PHP". How am I supposed to check this possibility? On my VDS I have permission types "for owner", "for groups" and "for those not in groups and not the owner", but I don't have any permissions for PHP (or I just don't know where to search). And those folders btw have the same permissions as the others.
That can be a tricky subject. It all depends on how PHP is invoked by your web server when it finds itself loading a .php file, and how the server handles permissions.
At its most basic, the web server will invoke the PHP interpreter using its own user (the web server's user). Thus if you have installed MODX, all of its files and folders will be owned by your user, not the web server user.
In such a case, the folders and files that MODX (a .php script) needs to write to need to have world-writable permissions (777 and 666), since they are owned by you but will use the web server's user.
It is now rare to find such a basic configuration in hosting servers. In most cases now there is a server configuration to run any scripts such as .php scripts as the same user as the script's owner. This means that the files and folders only need write permission for the owner.
If you see that the files and folders are set to permissions like 755 for folders and 644 for files, it almost certainly means the scripts will run as their owner and you'll have no problems.
As Susan says, it's rarely a problem, especially if you use a MODX-friendly host. If you want to check, though, you can create a test.php file in the MODX root with this code:
<?php
$dirs = array(
'core/cache',
'core/config',
);
foreach ($dirs as $dir) {
echo '<br />';
if (is_writable($dir)) {
echo $dir . ' is writable';
} else {
echo $dir . ' is NOT writable';
}
}
If you see that the files and folders are set to permissions like 755 for folders and 644 for files, it almost certainly means the scripts will run as their owner and you'll have no problems.
So, to be sure everything will work fine I should set 755 for the folders themselves and 644 for their files (for the owner), shouldn't I?
BobRay, thank you for the script. I'll do the test also.