Getting this error Class 'core_component

Getting this error Class 'core_component

by Madhav Balu -
Number of replies: 3

Hi there,i am using moodle3.6.4 and php7.4.When I am going to install moodle I am getting the below error.I have added config.php and gave appropriate permissions as well. Can anyone give me suggestions to solve this issue?


Fatal error: Uncaught Error: Class 'core_component' not found in /var/www/html/admin/index.php:97 Stack trace: #0 {main} thrown in /var/www/html/admin/index.php on line 97

Attachment Screenshot from 2020-12-27 15-24-32.png
Average of ratings: -
In reply to Madhav Balu

Re: Getting this error Class 'core_component

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Moodle 3.6.x doesn't support PHP 7.4: "minimum PHP 7.0.0 […] PHP 7.1.x, 7.2.x and 7.3.x (since Moodle 3.6.4) are supported too".

That said, I wouldn't expect that specific error so you may need to check that the source code files have all been transferred to the server, the class core_component is defined in lib/classes/component.php so you might get this error if this file was missing. But fix the PHP version first.

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: Getting this error Class 'core_component

by Madhav Balu -
Thanks, Leon for your suggestion, like you said source file was missing and now I have changed PHP version to 7.2 and changed moodle version to 3.9.2, but this time getting a different error "installation must be finished from the original IP address, sorry".I am installing moodle in ecs docker environment due to target health checks IP address changed .is there any solution for this one or else do I have launch a new ecs ec2 and start over again.
In reply to Madhav Balu

Re: Getting this error Class 'core_component

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

I don't have any expertise regarding this. However, this post suggests creating the file local/defaults.php containing the line:

$defaults['moodle']['getremoteaddrconf'] = 3;
The advice is a bit inconsistent so you may need to experiment with these settings.