Help - Being Bombarded with PHP Warnings from Cron Job

Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Les Bell בתאריך
מספר תגובות: 15

I just upgraded the PHP version on our Moodle server to PHP 7.1.12 and it's now bombarding me with PHP warning emails every five minutes. I'll get to the source of the error later, but right now, I just need it to shut up so I can think (plus I've got exam papers to mark עצוב ).

I've edited /etc/php.ini and set

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~E_CORE_WARNING

but I'm still getting the emails. I've looked in Moodle's config.php and read the Moodle Docs "Debugging" page, but I'm not seeing any setting that will let me reduce the logging level.

Can anyone please point me to the right log level setting?

For anyone interested, the error message is:

"PHP Warning:  Narrowing occurred during type inference. Please file a bug report on bugs.php.net in /var/www/html/moodle/lib/setup.php on line 597"

but line 597 is just:

require_once($CFG->libdir .'/accesslib.php');       // Access control functions

Technical Info:

OS: CentOS Linux release 7.4.1708 (Core)

PHP version: PHP 7.1.12 (cli) (built: Nov 22 2017 08:25:12) ( NTS )

Moodle version: 3.4

ממוצע דרוגים: -
בתגובה ל: Les Bell

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Les Bell בתאריך

For anyone else experiencing this, despite some googling suggesting the issue was fixed in PHP 7.2 beta, updating to 7.2RC6 didn't fix the problem.

--- Les

בתגובה ל: Les Bell

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Les Bell בתאריך
For anyone else affected by this: after a little exploration and testing, I realized it's a parsing problem, and edited /etc/php.ini accordingly:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_PARSE

That seems to have shut it up for the time being; I'll dig into the underlying bug later.

--- Les

בתגובה ל: Les Bell

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Les Bell בתאריך

I dug a bit, but have given up trying to submit this into Tracker; it keeps telling me I've got to search for a similar bug, which I have done to the point of wasting too much time. Somebody else can figure it out.

בתגובה ל: Les Bell

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Matteo Scaramuccia בתאריך
תמונה של Core developers תמונה של Peer reviewers תמונה של Plugin developers
בתגובה ל: Les Bell

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Dani Bartol בתאריך

I have the same problem whit xampp, could you solve it?

Warning: Narrowing occurred during type inference. Please file a bug report on bugs.php.net in C:\xampp\htdocs\moodle\lib\setup.php on line 597
בתגובה ל: Dani Bartol

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Matteo Scaramuccia בתאריך
תמונה של Core developers תמונה של Peer reviewers תמונה של Plugin developers

Hi Dani,
what PHP version your Moodle instance is running on?

HTH,
Matteo

בתגובה ל: Matteo Scaramuccia

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Dani Bartol בתאריך

Hi, Matteo,


I'm running version 7.2

בתגובה ל: Dani Bartol

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Matteo Scaramuccia בתאריך
תמונה של Core developers תמונה של Peer reviewers תמונה של Plugin developers
בתגובה ל: Matteo Scaramuccia

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Dani Bartol בתאריך

Thanks Matteo, I will try to solve it with the help offered

בתגובה ל: Dani Bartol

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי luthfiya permatahati בתאריך

Hi Dani

Have you solved that problem? How did you solve that problem? because I have the same problem with you


בתגובה ל: luthfiya permatahati

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Les Bell בתאריך

Sorry - I got a bit busy and lost track of this page. I fixed the problem on my setup by editing /etc/php.ini, around line 460, to change the line:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

to read

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_PARSE

That at least shut up the error emails. Since then, I've upgraded my PHP version to 7.2.1 and Moodle to 3.4.1, and at least one of those upgrades also solved the problem, since I just removed that fix and all remains quiet.

I hope this helps.

--- Les

בתגובה ל: Matteo Scaramuccia

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי luthfiya permatahati בתאריך

hi Matteo, I have the same problem with Dani, but I'm still confused how to solve that, I have downloaded this : https://phpdev.toolsforresearch.com/php-7.2.2RC1-nts-Win32-VC15-x86.zip

How the next step? can you explain in detail? thank you..

בתגובה ל: Les Bell

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Terus E-learning בתאריך
תמונה של Plugin developers

did you try changing the following to false in your config.php file?


$CFG->showcrondebugging = true;

בתגובה ל: Terus E-learning

Re: Help - Being Bombarded with PHP Warnings from Cron Job

על ידי Les Bell בתאריך

No - that line was commented out and I presume that the default of 'false' applied.

Best,

--- Les