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:

  1. Log into cPanel.
  2. 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).
  3. Select the lib.php, right click it and choose "Code Editor" to open the file for editing.
  4. Find the following lines of code:
  5. public static function get_behaviour_required_behaviours($behaviour) {
    $class = 'qbehaviour_' . $behaviour;
    return $class::get_required_behaviours();
    }

  6. Replace:
  7. return $class::get_required_behaviours();

    With:

    eval('$ret = ' . $class . '::get_required_behaviours();');
    return $ret;

  8. The function should now look like this:
  9. public static function get_behaviour_required_behaviours($behaviour) {
    $class = 'qbehaviour_' . $behaviour;
    eval('$ret = ' . $class . '::get_required_behaviours();');
    return $ret;
    }

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

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Tim Sisson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. Cpanel license is expired
  2. How do I provide a truly secure FTP site for my client to upload files with sensitive data (PHI - Personal Health Information, as referred to by HIPAA)?
  3. styles are not rendering on initial page load

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!