Error on Cron.php

Hi to everybody

When I´m going to execute cron.php I retrieve following error:

Fatal error: Uncaught Exception: cron.php is CLI only. in htdocs/include/utils.php:1691 Stack trace: #0 /htdocs/cron.php(49): sugar_die(‘cron.php is CLI…’) #1 {main} thrown in htdocs/include/utils.php on line 1691

version of suiteCRM is 4.5.0

Some suggestion ?

Thank you

Piercarlo

This means you’re trying to execute cron.php by calling it from a browser, or some other method like curl or wget, that sends the request through the web server.

But that file is not meant to run from the web server, but rather to be called from the command-line php (CLI).

Normally what you do is configure your crontab to run it. But if you really want to run it from the web server, and are able to secure that properly, then you can just remove that check by within cron.php. It will work just fine.

See my blog for a full explanation of SuiteCRM Scheduler jobs and cron.php.

1 Like