After running like a charm for many months, for some reason my cron job entry disappeared off my cpanel. After re-entering the following;
cd /home/myfolder/public_html/crm; php -f cron.php > /dev/null 2>&1
and various iterations of it, I keep getting the following error in error.log for each schedule job it seems.
[11-Apr-2023 23:02:01 UTC] PHP Warning: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time in /home/myfolder/public_html/crm/include/entryPoint.php on line 169
[11-Apr-2023 23:02:01 UTC] PHP Warning: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time in /home/myfolder/public_html/crm/include/entryPoint.php on line 170
[11-Apr-2023 23:02:01 UTC] PHP Fatal error: Uncaught Exception: cron.php is CLI only. in /home/myfolder/public_html/crm/include/utils.php:1978
Stack trace: #0 /home/myfolder/public_html/crm/cron.php(52): sugar_die(‘cron.php is CLI…’) #1 {main}
thrown in /home/myfolder/public_html/crm/include/utils.php on line 1978
it would be nice to understand where that error is coming from.
I suggest removing the cron entry you made. I think your error will still occur. And I suspect this is because something else is calling cron.php via the web server (some web service like easycron), or something that your hosting cooked up.
Thanks abuzarfaris, however I don’t have a legacy folder in my installation, so I fail to see how this would work. Besides, my cron has been working previously.
Hi pgr, I removed the cron entry from the server, no errors occur.
As soon as I put the cron entry back, the error (as per first post) occurs for each schedule job that is to be executed ‘as often as possible’.
This is a mystery to me, so any help understanding what is causing this is appreciated.
The “public/legacy” folder is for v8 installations.
If you’re entering the cron schedule through Cpanel, it seems that CPanel is not behaving normally and calling cron through the command-line. Maybe they have a new version and it changed something.
The code tests this:
$sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) != 'cli') {
sugar_die("cron.php is CLI only.");
}
You can try printing that value and seeing what it contains, replace all that code above (in cron.php at the root of your SuiteCRM installation) with this:
$sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) != 'cli') {
sugar_die("cron.php is CLI only, got $sapi_type instead.");
}
And then make the error appear again and tell us what you see.
[12-Apr-2023 21:53:02 UTC] PHP Warning: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time in /home/terryl/public_html/crm/include/entryPoint.php on line 169
[12-Apr-2023 21:53:02 UTC] PHP Warning: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time in /home/terryl/public_html/crm/include/entryPoint.php on line 170
[12-Apr-2023 21:53:02 UTC] PHP Fatal error: Uncaught Exception: cron.php is CLI only, got cgi-fcgi instead. in /home/terryl/public_html/crm/include/utils.php:1978
Stack trace: #0 /home/terryl/public_html/crm/cron.php(57): sugar_die(‘cron.php is CLI…’) #1 {main}
thrown in /home/terryl/public_html/crm/include/utils.php on line 1978
So the question is, what is cgi-fcgi ?? I see it’s some kind of bridge from CGI to FastCGI.