I am trying to start the cronjob via shell, as it does not execute via crontab.
When I type php5 cron.php
The output is only
X-Powered-By: PHP/5.5.26
Content-type: text/html
And no jobs are beeing executed.
What am I doing wrong?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI am trying to start the cronjob via shell, as it does not execute via crontab.
When I type php5 cron.php
The output is only
X-Powered-By: PHP/5.5.26
Content-type: text/html
And no jobs are beeing executed.
What am I doing wrong?
You are not using the CLI version of PHP. Ask your hoster which command to use or if you want to try finding it yourself, type:
ls -l `which php5`
which shows you where php5
is located and if it is a symlink. then look in the directory (or the directory of the symlink) if you can find something like php5-cli
Also, you should specify the mode like this:
php cron.php -mdefault
php cron.php -malways
Otherwise, cron.php starts cron.sh which then spawns cron.php again with both variations. Also it redirects all output to /dev/null
.
I strongly recommend using the alternative cron runner from Aoe_Scheduler which gives you much more control and information. Also it explains you exactly how to set up the system cronjob.
/usr/local/.../bin/php-cli cron.php -mdefault
and I get back: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/.../cron.php on line 43
which is Mage::app('admin')->setUseSessionInUrl(false);
The funny thing is, that everything worked well before the 1.9.2 update.
Jul 20, 2015 at 16:28
-mdefault
to the php5-5.5 command.
Jul 20, 2015 at 16:41