Moodle Migration Problem in messagelib.php about missing lib.php

Moodle Migration Problem in messagelib.php about missing lib.php

by Flameater Flameater -
Number of replies: 2

I am not able to access my moodle website after having moved it from http://getamarks.com to http://managementlearning.net - which is on a different server.


What is the error?

Warning: require_once(/home/manageme/public_html/moodle/lib/../message/lib.php): failed to open stream: No such file or directory in /home/manageme/public_html/moodle/lib/messagelib.php on line 27

Fatal error: require_once(): Failed opening required '/home/manageme/public_html/moodle/lib/../message/lib.php' (include_path='/home/manageme/public_html/moodle/lib/pear:.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/manageme/public_html/moodle/lib/messagelib.php on line 27


Analysing the error

That line (27) in messagelib.php goes like this:

require_once(__DIR__ . '/../message/lib.php');


Here's the heart of the problem

Meaning that it is looking for and has failed to open the file lib.php in the message directory - and that file is actually there.

Why does Moodle say that it failed opening the file? ie Why does it say ...

No such file or directory in /home/manageme/public_html/moodle/lib/messagelib.php on line 27 which is referring to the file /home/manageme/public_html/moodle/lib/../message/lib.php which is actually not missing

The slash between message and lib seems to have gone away. However, the salsh is there in lin2 27 of messsagelib.php. Furthermore the exact same program is running okay on the original website.


What I have done

  1. Copied over the entire Moodle directory
  2. Copied over the entire MoodleData directory
  3. Changed the config.php file - updated database options, cfg->wwwroot, cfg->dataroot and also added a cfg->datadir entry (same as dataroot)
  4. Ran the Moodle Search And Replace tool - https://docs.moodle.org/35/en/Search_and_replace_tool
  5. Downloaded the database script and ensured that all records that used to point to directories on the old server are now pointing to the new server


Thank you for your help, everyone.

Average of ratings: -
In reply to Flameater Flameater

Re: Moodle Migration Problem in messagelib.php about missing lib.php

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Firstly, it didn't say it isn't there... it said it can't open it. That could be because of incorrect permissions. 

- check your file permissions (especially that lib file)

- check your web server's error log in case it provides more clues about what is going wrong. 

In reply to Flameater Flameater

Re: Moodle Migration Problem in messagelib.php about missing lib.php

by Ken Task -
Picture of Particularly helpful Moodlers

When you copied files from old domain server to new domain server you've shared what you did ... code directory and data directory, but you didn't mention (unless am not understanding) doing an SQL dump of the database on old domain and transferring that .sql file to new domain server *and* and importing that SQL dump to a DB server on new domain.

Is new domain still pointed to the old DB server?

'spirit of sharing', Ken