Problem in viewing the site after upgradation

Problem in viewing the site after upgradation

- Diksha Academy の投稿
返信数: 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.

Diksha Academy への返信

Re: Problem in viewing the site after upgradation

- Leon Stringer の投稿
画像 Core developers 画像 Particularly helpful Moodlers
Leon Stringer への返信

Re: Problem in viewing the site after upgradation

- Diksha Academy の投稿
The PHP version is PHP 8.0
Diksha Academy への返信

Re: Problem in viewing the site after upgradation

- Howard Miller の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers
Well... there's your problem. Moodle doesn't (yet) support PHP 8
Howard Miller への返信

Re: Problem in viewing the site after upgradation

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

Paul R への返信

Re: Problem in viewing the site after upgradation

- Howard Miller の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 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.