• Home
  • /Magento CRON active

If you are going to use the auto running reports, we must activate Magento cron, for it depending on the server where we installed Magento will be made one way or another.

The key to activate the Magento Cron idea is that the “cron.php” file in the root of Magento installation run every 5 minutes.

To do this we create a scheduled task, depending on the server, if a Linux create a task that runs this judgment:

/usr/bin/php -q /var/www/vhosts/domain.com/httpdocs/magento/cron.php

Obviously we will have to locate in our server the path where the file is.

If this error appears when you turn on cron in the system log

ERR (3): Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/domain.com/httpdocs/magento/cron.php on line 67

This is because the server hasn’t enabled the shell_exec function, but there is a bug in the file cron.php file does not detect this, so it can activate the function or edit the cron.php file and add a line when disabled features are detected, for it if the original file has this part:

$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;

Add the line in bold:

$disabledFuncs = explode(',', ini_get('disable_functions'));
$disabledFuncs = array_map('trim', $disabledFuncs );
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;

There is a plugin very useful and necessary to check the scheduled tasks and magento know what time they are to run, called AOE Scheduler, which you can find on this page: