Cannot access localhost after installing Moodle

Cannot access localhost after installing Moodle

by Robert Pee -
Number of replies: 1
Hi all,

I hope you'll be able to help me. I'm currently trying to build a moodle course, hosted on my computer. I downloaded Moodle from this site yesterday and was able to create a localhost site and a course.

However, when I tried to access the site again today, I got an error message stating "this site can't be reached localhost refused to connect."

I have tried various solutions to this, such as:

-de-installing and reinstalling Moodle
-disabling the firewall
-flushing the dns cache
-changing the port

After all this, I am now getting this error message: 

Not Found

The requested URL was not found on this server.


Apache/2.4.54 (Win64) OpenSSL/1.1.1p PHP/8.1.10 Server at localhost Port 80
I was wondering if anyone knows what the problem might be, and the best way to fix it?

Thanks in advance for your help and suggestions.
Average of ratings: -
In reply to Robert Pee

Re: Cannot access localhost after installing Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

The web server throws "Site not found" errors, often before it even sees Moodle. So you have to check bottom up.

First of all, both times only one computer is involved, right, you are not trying from another computer in the LAN, right? And always the URL you try is http://localhost/? One illogical thing, as this is know to happen in Windows computers, try http://127.0.0.1/.

If no difference, create a file test.html in the Moodle code directory (that is where the config.php file is) and try visiting http://localhost/test.html or http://127.0.0.1/test.html. You should see the content of test.html rendered. If that is not happening, the problem is purely a web server or operating system issue.

If you test.html rendered, then create a file phpinfo.php in the same directory with the single liner

<?php phpinfo(); ?>
as its content. Then visit http://localhost/phpinfo.php or http://127.0.0.1/phpinfo.php. You should see a long table with all sorts of system information.

On a side note, no Moodle current stable version, 3.9, 3.11 and 4.0, is PHP 8.1 compatible - only the development (beta) version of 4.1 will be. Where did you get the Moodle code (link)? How did you install it, link to the tutorial?

P.S. I haven't touched Windows for well over a decade. I can do everything I want with Free and Open Source Software. My intention here was to uncover all the relevant information about your case so that a Windows expert can take over.