Cron Job setup

Good morning everyone,about cron job setting , I have some problems, there is no problem in setting “schoolAdmin_tutorDailyEmailSummary.php”, but “planner_parentWeeklyEmailSummary.php” has no action, whether this weeklyemailsummary needs to be setup on Friday afternoon, or any time, do I need to make any settings before execution?

Hi Kevin, it is nice to see you here in the forums. We run this script each Friday without issues, and so I wonder if there is a PHP issue to do with versioning or something else specific to your system. Can you check your PHP error logs to see if anything is showing there? Thanks! Ross

Hello Ross, thank you for help , my PHP version is

and PHP error logs file is this?

No problem at all Kevin : ) If you open that error_log file, is there anything in there relating to the script in question? PHP7.4 should be fine for Gibbon.

Good Morning Ross, this is what i find

thrown in /home/xapwodeh/public_html/gibbon/cli/planner_parentWeeklyEmailSummary.php on line 29
[01-Mar-2022 14:00:01 Asia/Taipei] PHP Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 70
[01-Mar-2022 14:00:01 Asia/Taipei] PHP Warning: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 73
[01-Mar-2022 14:00:01 Asia/Taipei] PHP Warning: session_cache_limiter(): Cannot change cache limiter when headers already sent in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 74
[01-Mar-2022 14:00:01 Asia/Taipei] PHP Warning: session_start(): Cannot start session when headers already sent in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 78
[01-Mar-2022 14:00:01 Asia/Taipei] PHP Notice: Undefined index: argv in /home/xapwodeh/public_html/gibbon/functions.php on line 1461
[01-Mar-2022 14:00:01 Asia/Taipei] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/xapwodeh/public_html/gibbon/functions.php on line 1461
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 70
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Warning: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 73
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Warning: session_cache_limiter(): Cannot change cache limiter when headers already sent in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 74
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Warning: session_start(): Cannot start session when headers already sent in /home/xapwodeh/public_html/gibbon/src/Session/SessionFactory.php on line 78
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Notice: Undefined index: argv in /home/xapwodeh/public_html/gibbon/functions.php on line 1461
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/xapwodeh/public_html/gibbon/functions.php on line 1461
[01-Mar-2022 14:09:01 Asia/Taipei] PHP Fatal error: Uncaught Error: Call to undefined function getSettingByScope() in /home/xapwodeh/public_html/gibbon/cli/behaviour_letters.php:55
Stack trace:

Hi Kevin,

This is odd, it looks like the isCommandLineInterface method is causing a PHP warning when checking the $_SERVER[‘argv’] value, which then writes out the error, which then interrupts the headers. A couple things to try:

Can you ensure that display_errors is turned off in your PHP ini, alternatively you could try adding ini_set(‘display_errors’, 0);` to the bottom of your config.php file. This should prevent displaying the errors, which prevents breaking the headers.

For the argv error, you could also try changing line 1461 in functions.php so that instead of count($_SERVER[‘argv’]) it says <code class="CodeInline">count($_SERVER['argv'] ?? []) … This should prevent this error, which seems to be related to your server not having an argv value.

Hope this helps!

Thank you Sandra, i will try by myself…
but i find another error from different files

and this is the information i cut from the file
[24-Mar-2022 12:31:02 Asia/Taipei] PHP Warning: require(/home/xapwodeh/…/gibbon.php): failed to open stream: No such file or directory in /home/xapwodeh/public_html/gibbon/cli/planner_parentWeeklyEmailSummary.php on line 23
[24-Mar-2022 12:31:02 Asia/Taipei] PHP Fatal error: require(): Failed opening required ‘/home/xapwodeh/…/gibbon.php’ (include_path=‘.:/opt/alt/php74/usr/share/pear’) in /home/xapwodeh/public_html/gibbon/cli/planner_parentWeeklyEmailSummary.php on line 23

and this is the 1461 in functions.php
i am not sure what data i need changed

Hi Kevin, it looks like there are some other unusual errors going on, some perhaps related to system setup, or cron job setup.

The require /home/xapwodeh/…/gibbon.php should be require <code class="CodeInline">/home/xapwodeh/public_html/gibbon/cli/../gibbon.php. I wonder if there is a symbolic link setup as part of your server configuration. You could try changing the line that says:

require DIR.‘/…/gibbon.php’; into <code class="CodeInline">require realpath(__DIR__).'/../gibbon.php';
to help ensure that symlinks are resolved.

For line 1461 of functions.php, the updated line should read:

if (empty($_SERVER[‘REMOTE_ADDR’]) and !isset($_SERVER[‘HTTP_USER_AGENT’]) and count($_SERVER[‘argv’] ?? []) > 0)`

Hope this helps! I suspect there are some non-standard server configurations at play here. Are you using a self-hosted or shared-hosting server?

Morning, i use shared-hosting server,maybe that is the reason.but i will try first.

sorry, i want to fix this part,which file i need changed data?

Hi Kevin, you should be able to see and replace that line at the top of any of the CLI scripts you’re using.

i try a lot of times, still get this wrong message, i use two different CLI

[25-Mar-2022 15:36:01 Asia/Taipei] PHP Warning: require(/home/xapwodeh/…/gibbon.php): failed to open stream: No such file or directory in /home/xapwodeh/public_html/gibbon/cli/schoolAdmin_parentWeeklyEmailSummary.php on line 32

[25-Mar-2022 15:36:01 Asia/Taipei] PHP Fatal error: require(): Failed opening required ‘/home/xapwodeh/…/gibbon.php’ (include_path=‘.:/opt/alt/php74/usr/share/pear’) in /home/xapwodeh/public_html/gibbon/cli/schoolAdmin_parentWeeklyEmailSummary.php on line 32

[25-Mar-2022 15:49:02 Asia/Taipei] PHP Warning: require(/home/xapwodeh/…/gibbon.php): failed to open stream: No such file or directory in /home/xapwodeh/public_html/gibbon/cli/planner_parentWeeklyEmailSummary.php on line 23

[25-Mar-2022 15:49:02 Asia/Taipei] PHP Fatal error: require(): Failed opening required ‘/home/xapwodeh/…/gibbon.php’ (include_path=‘.:/opt/alt/php74/usr/share/pear’) in /home/xapwodeh/public_html/gibbon/cli/planner_parentWeeklyEmailSummary.php on line 23