Skip to content
Advertisement

Can’t reach Moodle (a system written in PHP) from other devices

First time to install Moodle and am installing it locally on Windows 10 using WAMP. My knowledge in Apache and servers in general is very limited. Installation completed successfully and every thing is working fine on my localhost but when i try to access it from other devices (i.e another laptop using chrome) i will be redirected to “http://localhost/moodle” and get the message “This Site can’t be reached” although i can access “MyphpAdmen” page after i altered its alias file. I know bet of coding, so i created an alias file for Moodle copying the same code from Myphpadmin’s alias file with some changes to look like this

JavaScript

and it didn’t work,any help will be appreciated.

Advertisement

Answer

It wasn’t a permission issue after all. I noticed that when i type the address of the Moodle server (http://1.1.1.1/moodle) from other devices ,i will be redirected to “http://localhost/moodle“, and to resolve this i just had to edit a line in Moodle’s config.php file like this:

JavaScript

to this

JavaScript

Change 1.1.1.1 to your server’s Ip

the source of this solution :Moodle in English

Little Tweaking : You might use your server on different stations with different Ip’s Range,In that case you will have to update your Config file every time you change your server ip,so i made this little code to automate the updating :

JavaScript

hope it helps.Thanks!.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement