Help - Being Bombarded with PHP Warnings from Cron Job

Help - Being Bombarded with PHP Warnings from Cron Job

by Les Bell -
Number of replies: 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 sad ).

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

Average of ratings: -
In reply to Les Bell

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

by 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

In reply to Les Bell

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

by 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

In reply to Les Bell

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

by 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.

In reply to Les Bell

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

by 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
In reply to Dani Bartol

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

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

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

HTH,
Matteo

In reply to Matteo Scaramuccia

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

by Dani Bartol -

Hi, Matteo,


I'm running version 7.2

In reply to Dani Bartol

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

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
In reply to Matteo Scaramuccia

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

by Dani Bartol -

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

In reply to Dani Bartol

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

by luthfiya permatahati -

Hi Dani

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


In reply to luthfiya permatahati

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

by 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

In reply to Les Bell

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

by Terus E-learning -
Picture of Plugin developers

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


$CFG->showcrondebugging = true;

In reply to Terus E-learning

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

by Les Bell -

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

Best,

--- Les