Editing the lib.php file in Moodle Carrie SmahaUpdated on August 16, 2021 1 Minute Read Editing the lib.php file is one possible work around for resolving an issue with a Moodle installation completed through Fantastico in cPanel. Once the installation is complete and an administrator logs into Moodle, a blank white screen appears instead of the expected administration error. This error, caused by a PHP version mismatch can be resolved through either editing the lib.php file or manually installing an older version of Moodle that doesn’t require PHP 5.3. Before making changes, making a full backup is highly recommended. Fortunately, editing the lib.php file can easily be done through the cPanel File Manager and we’ll walk you through it: Log into cPanel. Click on “File Manager” and navigate to the question/engine subfolder inside your Moodle installation (i.e. public_html/question/engine, /public_html/moodle/question/engine or something similar depending on where you installed Moodle). Select the lib.php, right click it and choose “Code Editor” to open the file for editing. Find the following lines of code: public static function get_behaviour_required_behaviours($behaviour) { $class = ‘qbehaviour_’ . $behaviour; return $class::get_required_behaviours(); } Replace: return $class::get_required_behaviours(); With: eval(‘$ret = ‘ . $class . ‘::get_required_behaviours();’); return $ret; The function should now look like this: public static function get_behaviour_required_behaviours($behaviour) { $class = ‘qbehaviour_’ . $behaviour; eval(‘$ret = ‘ . $class . ‘::get_required_behaviours();’); return $ret; } Click the Save Changes button in the upper right of the window. Now, when we go back to our site where Moodle is installed we can log in and see the Moodle administration area. Share this Article Carrie Smaha Senior Manager Marketing Operations Carrie Smaha is a digital strategy, web development, and SEO leader with 20 years of experience. She built her foundation in fast-paced agency environments before moving in-house to InMotion Hosting, where she leads go-to-market programs, agency initiatives, and technical product marketing that connects product capability to real customer decisions. More Articles by Carrie Related Articles Setting up an SMTP Connection in Moodle How to install Moodle using Fantastico Installing Moodle with Softaculous How to Add Content Security Policy in Moodle With the Local CSP Plugin Inserting an image slider in Moodle Changing the Moodle admin password through PhpMyAdmin Fix “uploaded file may exceed the post_max_size directive in php.ini” How to Add the Quiz Module in Moodle Adding the File Resource Module to Moodle Courses Integrate Jitsi with Moodle Courses