{"id":2454,"date":"2012-12-26T16:31:07","date_gmt":"2012-12-26T16:31:07","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2012\/12\/26\/errors-unicode-database-undefined-constant\/"},"modified":"2020-12-14T11:49:13","modified_gmt":"2020-12-14T16:49:13","slug":"moodle-installation-errors","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/","title":{"rendered":"Common Moodle Installation Errors and How to Fix Them"},"content":{"rendered":"<p>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 <strong>Use of undefined constant<\/strong>, <strong>Database driver<\/strong>, and<strong> Database unicode errors<\/strong>. This article will explain what causes these errors and how to fix them.<\/p>\n<h2>Error: Use of undefined constant PHP<\/h2>\n<p>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.<\/p>\n<p><code style=\"word-wrap: break-word;\">Notice: Use of undefined constant <strong>DIR<\/strong> - assumed '<strong>DIR<\/strong>'<br \/>\nin \/home\/user\/public_html\/lib\/dml\/moodle_database.php on line 27<br \/>\nWarning: require_once(<strong>DIR<\/strong>\/database_column_info.php) [function.require-once]:<br \/>\nfailed to open stream: No such file or directory in \/home\/user\/public_html\/lib\/dml\/moodle_database.php on line 27<br \/>\nFatal error: require_once() [function.require]: Failed opening required '<strong>DIR<\/strong>\/database_column_info.php'<br \/>\n(include_path='.:\/usr\/lib\/php:\/usr\/local\/lib\/php:\/home\/user\/php')<br \/>\nin \/home\/user\/public_html\/lib\/dml\/moodle_database.php on line 27<\/code><\/p>\n<p>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, <a title=\"Click here for how to contact support\" href=\"https:\/\/www.inmotionhosting.com\/support\/amp\/how-to-get-great-technical-support\/\" target=\"_blank\" rel=\"noopener noreferrer\">contact support<\/a> to request the server move or PHP upgrade.<\/p>\n<h2>Error: Database driver problem detected<\/h2>\n<p>The database driver error is caused by an outdated version of MySQL. The following is copy of the error.<\/p>\n<p><code style=\"word-wrap: break-word;\">Error: database driver problem detected<br \/>\nThe site administrator should verify server configuration<br \/>\nPHP has not been properly configured with the MySQLi extension so<br \/>\nthat it can communicate with MySQL. Please check your php.ini file<br \/>\nor recompile PHP. MySQLi extension is not available for PHP 4.<\/code><\/p>\n<p>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 <a title=\"Click here for how to contact support\" href=\"https:\/\/www.inmotionhosting.com\/support\/amp\/how-to-get-great-technical-support\/\" target=\"_blank\" rel=\"noopener noreferrer\">submitting a ticket<\/a>.<\/p>\n<h2>Error: Database unicode character<\/h2>\n<p>When installing Moodle on a new database, if the encoding is not set correctly, the following error will occur.<\/p>\n<p><code style=\"word-wrap: break-word;\">It is required that you store all your data in Unicode format (UTF-8).<br \/>\nNew installations must be performed into databases that have their default<br \/>\ncharacter set as Unicode. If you are upgrading, you should perform the<br \/>\nUTF-8 migration process (see the Admin page).<\/code><\/p>\n<p>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.<\/p>\n<h3>Changing the database collation in PhpMyAdmin<\/h3>\n<ol class=\"article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\"><strong>Login to your cPanel<\/strong><\/a><\/li>\n<li>Navigate to <strong>Databases<\/strong> &gt; <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/manage-mysql-database-in-phpmyadmin\/\"><strong>PhpMyAdmin<\/strong><\/a>.<\/li>\n<li><strong>Select the database<\/strong> on the left that was created for the Moodle site.<\/li>\n<li>On the top right <strong>click Operations<\/strong>.<\/li>\n<li><strong>On the Collation drop box, select utf8_unicode_ci<\/strong>.<\/li>\n<li><strong>Click Go<\/strong>.<\/li>\n<\/ol>\n<p>Now when you install Moodle, the error will not appear.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[25,4335],"tags":[],"class_list":["post-2454","post","type-post","status-publish","format-standard","hentry","category-moodle","category-error-numbers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Common Moodle Installation Errors and How to Fix Them<\/title>\n<meta name=\"description\" content=\"How to fix the Use of undefined constant, Database driver, and Database unicode errors when installing Moodle.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Common Moodle Installation Errors and How to Fix Them\" \/>\n<meta property=\"og:description\" content=\"How to fix the Use of undefined constant, Database driver, and Database unicode errors when installing Moodle.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-26T16:31:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-14T16:49:13+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"Common Moodle Installation Errors and How to Fix Them\",\"datePublished\":\"2012-12-26T16:31:07+00:00\",\"dateModified\":\"2020-12-14T16:49:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\"},\"wordCount\":330,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Moodle\",\"Website Error Numbers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\",\"name\":\"Common Moodle Installation Errors and How to Fix Them\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2012-12-26T16:31:07+00:00\",\"dateModified\":\"2020-12-14T16:49:13+00:00\",\"description\":\"How to fix the Use of undefined constant, Database driver, and Database unicode errors when installing Moodle.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Common Moodle Installation Errors and How to Fix Them\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Common Moodle Installation Errors and How to Fix Them","description":"How to fix the Use of undefined constant, Database driver, and Database unicode errors when installing Moodle.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/","og_locale":"en_US","og_type":"article","og_title":"Common Moodle Installation Errors and How to Fix Them","og_description":"How to fix the Use of undefined constant, Database driver, and Database unicode errors when installing Moodle.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2012-12-26T16:31:07+00:00","article_modified_time":"2020-12-14T16:49:13+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"Common Moodle Installation Errors and How to Fix Them","datePublished":"2012-12-26T16:31:07+00:00","dateModified":"2020-12-14T16:49:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/"},"wordCount":330,"commentCount":2,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Moodle","Website Error Numbers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/","name":"Common Moodle Installation Errors and How to Fix Them","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2012-12-26T16:31:07+00:00","dateModified":"2020-12-14T16:49:13+00:00","description":"How to fix the Use of undefined constant, Database driver, and Database unicode errors when installing Moodle.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/moodle-installation-errors\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Common Moodle Installation Errors and How to Fix Them"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2454"}],"version-history":[{"count":6,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2454\/revisions"}],"predecessor-version":[{"id":62478,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2454\/revisions\/62478"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}