Problem in viewing the site after upgradation

Problem in viewing the site after upgradation

by Diksha Academy -
Number of replies: 5

Hi,

Getting the below errors after upgrading the Moodle version to latest:

Deprecated: Return type of navigation_node_collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/navigationlib.php on line 1257

Deprecated: Return type of navigation_node_collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/navigationlib.php on line 1246

Deprecated: Return type of moodle_recordset::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/dml/moodle_recordset.php on line 61

Deprecated: Return type of context::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/accesslib.php on line 5219

Deprecated: Return type of cm_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/modinfolib.php on line 1568

Deprecated: Return type of section_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/modinfolib.php on line 3206

Deprecated: Return type of mysqli_native_moodle_recordset::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/dml/mysqli_native_moodle_recordset.php on line 65

Deprecated: Return type of mysqli_native_moodle_recordset::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/dml/mysqli_native_moodle_recordset.php on line 78

Deprecated: Return type of mysqli_native_moodle_recordset::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/dml/mysqli_native_moodle_recordset.php on line 69

Deprecated: Return type of mysqli_native_moodle_recordset::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/dikshbjq/public_html/lib/dml/mysqli_native_moodle_recordset.php on line 82

Pls help in resolving this.

Average of ratings: -
In reply to Diksha Academy

Re: Problem in viewing the site after upgradation

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers
In reply to Leon Stringer

Re: Problem in viewing the site after upgradation

by Diksha Academy -
The PHP version is PHP 8.0
In reply to Diksha Academy

Re: Problem in viewing the site after upgradation

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Well... there's your problem. Moodle doesn't (yet) support PHP 8
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Problem in viewing the site after upgradation

by Paul R -

Moodle 4 now works with php8.0 but I've just had this issue today.  

I realised cron was not working. I ran cron.php from the command line and got the error. 

Checked phpinfo - definitely version 8.0

Then realised it is possible to have a different version of php running on the command line than under Apache

The command line version was 8.1 

Changed it to 8.0 and cron now works. 

Average of ratings: Useful (1)
In reply to Paul R

Re: Problem in viewing the site after upgradation

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
We get this a LOT. Everybody assumes that command line PHP and the "web" version will be the same but they don't have to be.

Also... *core* Moodle is now compatible with PHP 8. That doesn't mean that any optional plugins will be.