When installing Moodle 2.3, several errors can occur during the installation. Typical Moodle installation errors are caused by database encoding, PHP version, and the database version. The PHP errors thrown are the Use of undefined constant, Database driver, and Database unicode errors. This article will explain what causes these errors and how to fix them.

Error: Use of undefined constant PHP

This error is caused by installing Moodle on a server with an incorrect version of PHP. An example of this error is similar to the following.

Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /home/user/public_html/lib/dml/moodle_database.php on line 27
Warning: require_once(__DIR__/database_column_info.php) [function.require-once]:
failed to open stream: No such file or directory in /home/user/public_html/lib/dml/moodle_database.php on line 27
Fatal error: require_once() [function.require]: Failed opening required '__DIR__/database_column_info.php'
(include_path='.:/usr/lib/php:/usr/local/lib/php:/home/user/php') in /home/user/public_html/lib/dml/moodle_database.php on line 27

If you are on a shared business plan, you can have your account moved to a PHP 5.3 server. On VPS or Dedicated servers, the PHP version can be upgraded. In either case, contact support to request the server move or PHP upgrade.

Error: Database driver problem detected

The database driver error is caused by an outdated version of MySQL. The following is copy of the error.

Error: database driver problem detected
The site administrator should verify server configuration
PHP has not been properly configured with the MySQLi extension so
that it can communicate with MySQL. Please check your php.ini file
or recompile PHP. MySQLi extension is not available for PHP 4.

Fixing this error will depend on the type of server you are one. If you are on a Shared business plan, you will need to move to a server that supports MySQL version 5.1 or higher. Systems can move your account to a server that supports this. On a VPS or Dedicated, tech support can upgrade the MySQL version for you by submitting a ticket.

Error: Database unicode character

When installing Moodle on a new database, if the encoding is not set correctly, the following error will occur.

It is required that you store all your data in Unicode format (UTF-8).
New installations must be performed into databases that have their default
character set as Unicode. If you are upgrading, you should perform the
UTF-8 migration process (see the Admin page).

To fix this error, you will need to set the database collation in to utf8_unicode_ci through PhpMyAdmin. The following will explain how to do this.

Changing the database collation in PhpMyAdmin

  1. Login to your cPanel
  2. Navigate to Databases > PhpMyAdmin.
  3. Select the database on the left that was created for the Moodle site.
  4. On the top right click Operations.
  5. On the Collation drop box, select utf8_unicode_ci.
  6. Click Go.

    Now when you install Moodle, the error will not appear.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

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!