Fatal error: Cannot use 'object' as class name as it is reserved in /Library/WebServer/Documents/lib/setuplib.php on line 66

Fatal error: Cannot use 'object' as class name as it is reserved in /Library/WebServer/Documents/lib/setuplib.php on line 66

by Tim Kamps -
Number of replies: 3

I am getting this error on the root page on macOS 10.12.6 after upgrading from 3.2 to 3.5.1+.

When I access my created phpinfo.php file I get the php page to load showing I am running PHP Version 7.2.8

My mysql db seems to be running fine.

Searching seems to indicate that this was a problem in earlier versions of moodle with php 7.2 but has since been fixed.

Suggestions to further troubleshoot this error?

Thanks!

Tim


Average of ratings: -
In reply to Tim Kamps

Re: Fatal error: Cannot use 'object' as class name as it is reserved in /Library/WebServer/Documents/lib/setuplib.php on line 66

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This strongly implies that you are not running Moodle 3.5.1. Or... you have managed to retain some parts of 3.2 due to some error in the upgrade.

Can you confirm that you completely removed the old 3.2 code and replaced it with the 3.5.1 code?

In reply to Howard Miller

Re: Fatal error: Cannot use 'object' as class name as it is reserved in /Library/WebServer/Documents/lib/setuplib.php on line 66

by Chris P. -

Hi!

I've just upgraded to the latest moodle release and I'm also having similar problem, trying to launch the cron.php file:

Server Time: Mon, 03 Sep 2018 10:38:48 +0200
Execute scheduled task: Block Notifications Task (block_notifications\task\notify)
... started 10:38:49. Current memory use 18.5MB.
****** notifications :: begin ******PHP Fatal error:  Cannot use Object as Object because 'Object' is a special class name in /var/www/xxx/blocks/notifications/classes/User.php on line 4


I tried updates but everything is OK from moodle dashboard.  Also a GIT PULL is showing latest content already present...

Any ideas how to solve or tips please??  smile


EDIT: I'm running with PHP 7.2 on DEBIAN 9

In reply to Chris P.

Re: Fatal error: Cannot use 'object' as class name as it is reserved in /Library/WebServer/Documents/lib/setuplib.php on line 66

by Chris P. -

ok I found the solution: it's weird but NOTIFICATION additional block was mentionned as 2015 ....  and trying to update through moodle show not update release.

I then checked on Moodle plugins directory online and checked that latest release was from 2018....   after MANUALLY deleting the old one and reinstalling everything is OK now.    (upgrade was rejected but moodle that's why manual deletion was mandatory)