{"id":344,"date":"2011-12-14T18:18:33","date_gmt":"2011-12-14T18:18:33","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2011\/12\/14\/editing-the-libphp-file-in-moodle\/"},"modified":"2021-08-16T23:48:53","modified_gmt":"2021-08-17T03:48:53","slug":"editing-the-libphp-file-in-moodle","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/","title":{"rendered":"Editing the lib.php file in Moodle"},"content":{"rendered":"<p>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 href=\"\/support\/website\/moodle-requires-php-523-work-around\/\">a blank white screen<\/a> 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&#8217;t require PHP 5.3.<\/p>\n<p>Before making changes, <a href=\"\/support\/website\/backing-up-your-cpanel\/\">making a full backup<\/a> is highly recommended.<\/p>\n<p>Fortunately, editing the lib.php file can easily be done through the <a href=\"\/support\/\">cPanel File Manager<\/a> and we&#8217;ll walk you through it:<\/p>\n<ol class=\"article_list\">\n<li><a href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Log into cPanel<\/a>.<\/li>\n<li>Click on &#8220;File Manager&#8221; 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).<\/li>\n<li>Select the lib.php, right click it and choose &#8220;Code Editor&#8221; to open the file for editing.<\/li>\n<li>Find the following lines of code:<\/li>\n<p class=\"code_block\">public static function     get_behaviour_required_behaviours($behaviour) {<br \/>\n$class =     &#8216;qbehaviour_&#8217; . $behaviour;<br \/>\nreturn     $class::get_required_behaviours();<br \/>\n}<\/p>\n<li>Replace:<\/li>\n<p class=\"code_block\">return     $class::get_required_behaviours();<\/p>\n<p>With:<\/p>\n<p class=\"code_block\">eval(&#8216;$ret =     &#8216; . $class . &#8216;::get_required_behaviours();&#8217;);<br \/>\nreturn $ret;<\/p>\n<li>The function should now look like this:<\/li>\n<p class=\"code_block\">public static function     get_behaviour_required_behaviours($behaviour) {<br \/>\n$class =     &#8216;qbehaviour_&#8217; . $behaviour;<br \/>\neval(&#8216;$ret = &#8216; . $class .     &#8216;::get_required_behaviours();&#8217;);<br \/>\nreturn $ret;<br \/>\n}<\/p>\n<li>Click the <strong>Save Changes<\/strong> button in the upper right of the window.<\/li>\n<\/ol>\n<p>Now, when we go back to our site where Moodle is installed we can log in and see the Moodle administration area.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\"> Read More ><\/a><\/p>\n","protected":false},"author":56983,"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,4288],"tags":[],"class_list":["post-344","post","type-post","status-publish","format-standard","hentry","category-moodle","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Editing the lib.php file in Moodle | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to fix an error in Moodle 2.1 due to PHP 5.3 not being available.\" \/>\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\/editing-the-libphp-file-in-moodle\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Editing the lib.php file in Moodle | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to fix an error in Moodle 2.1 due to PHP 5.3 not being available.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\" \/>\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=\"2011-12-14T18:18:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:48:53+00:00\" \/>\n<meta name=\"author\" content=\"Carrie Smaha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@carriesmaha\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carrie Smaha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\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\/editing-the-libphp-file-in-moodle\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\"},\"author\":{\"name\":\"Carrie Smaha\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\"},\"headline\":\"Editing the lib.php file in Moodle\",\"datePublished\":\"2011-12-14T18:18:33+00:00\",\"dateModified\":\"2021-08-17T03:48:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\"},\"wordCount\":267,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Moodle\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\",\"name\":\"Editing the lib.php file in Moodle | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2011-12-14T18:18:33+00:00\",\"dateModified\":\"2021-08-17T03:48:53+00:00\",\"description\":\"Learn how to fix an error in Moodle 2.1 due to PHP 5.3 not being available.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Editing the lib.php file in Moodle\"}]},{\"@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\/595948dab2995d347a87076abdae19d8\",\"name\":\"Carrie Smaha\",\"description\":\"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/carriesmaha\/\",\"https:\/\/x.com\/carriesmaha\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Editing the lib.php file in Moodle | InMotion Hosting","description":"Learn how to fix an error in Moodle 2.1 due to PHP 5.3 not being available.","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\/editing-the-libphp-file-in-moodle\/","og_locale":"en_US","og_type":"article","og_title":"Editing the lib.php file in Moodle | InMotion Hosting","og_description":"Learn how to fix an error in Moodle 2.1 due to PHP 5.3 not being available.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2011-12-14T18:18:33+00:00","article_modified_time":"2021-08-17T03:48:53+00:00","author":"Carrie Smaha","twitter_card":"summary_large_image","twitter_creator":"@carriesmaha","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Carrie Smaha","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/"},"author":{"name":"Carrie Smaha","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8"},"headline":"Editing the lib.php file in Moodle","datePublished":"2011-12-14T18:18:33+00:00","dateModified":"2021-08-17T03:48:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/"},"wordCount":267,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Moodle","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/","name":"Editing the lib.php file in Moodle | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2011-12-14T18:18:33+00:00","dateModified":"2021-08-17T03:48:53+00:00","description":"Learn how to fix an error in Moodle 2.1 due to PHP 5.3 not being available.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/moodle\/editing-the-libphp-file-in-moodle\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Editing the lib.php file in Moodle"}]},{"@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\/595948dab2995d347a87076abdae19d8","name":"Carrie Smaha","description":"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.","sameAs":["https:\/\/www.linkedin.com\/in\/carriesmaha\/","https:\/\/x.com\/carriesmaha"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/344","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\/56983"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=344"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/344\/revisions"}],"predecessor-version":[{"id":86433,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/344\/revisions\/86433"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}