Problem with Moodle after domain renewal

Problem with Moodle after domain renewal

by randall jones -
Number of replies: 9

Yesterday my webhost renewed my domain name. After that I could no longer access my classes (just a blank browser page). Then today I get the error:

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

I went online and learned about this but my question is : in what folder/file is this dataroot variable?

I am using version 3.5 and is hosted on a Linux / Apache server. I did check permissions, they are all 755 and 644. And the files and DB is still there.

Not only that but when I tried to install a new moodle version using thier install software, the moode page looks totally krunked like there is no CSS (I made another post about that).  Any thoughts on this would be very helpful and appreciated. Here is a picture of the moodle I just installed. But really just want to get my original moodle back since it has all my content.


Attachment Capture.PNG
Average of ratings: -
In reply to randall jones

Re: Problem with Moodle after domain renewal

by randall jones -
Resolved the first problem, but I don't know how they did that. Still haven't fixed the CSS problem yet.
In reply to randall jones

Re: Problem with Moodle after domain renewal

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Your website is configured to redirect HTTP connections to HTTPS (secure), but Moodle is configured to use HTTP. Once an HTTPS page is loaded the browser blocks the HTTP content, e.g. CSS and JavaScript.

So you just need to change $CFG->wwwroot in config.php from 'http://yourwebsite' to https://yourwebsite'.

In reply to Leon Stringer

Re: Problem with Moodle after domain renewal

by randall jones -
Thanks Leon, can you tell me where the config.php file is located? I cannot find it.
In reply to randall jones

Re: Problem with Moodle after domain renewal

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Have you tried a google search for "moodle where is config.php located?"
In reply to randall jones

Re: Problem with Moodle after domain renewal

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

config.php is a file in the root (top-level) of the Moodle source code folder. This folder – also known as site home or document root – is where your web server serves your Moodle site from. It's where the Moodle source code was placed when installing the site. See this reply for files and subfolders in this folder to help identify it.

How you change config.php will depend on what you're using to access files on the server, e.g. File Manager in cPanel, or SSH using PuTTY. Does that help?

In reply to Leon Stringer

Re: Problem with Moodle after domain renewal

by randall jones -

Thanks Leon, I am using CP on a webhost.  Yes that moodledata folder is in the public_html. The moodledata folder has a dozen subfolders each with hundreds of more folders and files.  I did a search with the host's  provided search box which turned up nothing.  I'll be getting to know moodle very well in the next few days unless I find the file soon.  The host does not allow for terminal access otherwise I'd do a grep. The tech support did a few things for me and brought a lot of the site back to functionality but links to editing is gone as are access to videos I made which I suspect are on some 'cloud' server somewhere.  Seems fixing one thing brings on another problem.  I don't want to use another LMS.  Fortunately for me it is semester break here and classes don't start for another month. 

In reply to randall jones

Re: Problem with Moodle after domain renewal

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If you're still looking for config.php then this is in the first (i.e. highest level) folder containing the Moodle source code for the site. So if your site was https://www.example.com/mymoodle then the source code folder might be public_html/mymoodle. If you still can't find it post screenshots of what you do see and we'll try to help (crop or hide any information you don't want to share on the Internet).

If there are other problems you want help with, post a new discussion topic on the forum.

In reply to randall jones

Re: Problem with Moodle after domain renewal

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
If you are using cPanel (if this is what CP means,) then FileManger, click on public_html (or www), then on your moodle application folder. config.php should be in it.
Attachment where is config.png
Average of ratings: Useful (1)