Score:0

Apache2 won't load php files

cc flag

This has been getting on my nerves all day because I feel like it is such a simple fix, but can't figure it out. I installed Moodle through Ubuntu 20.04 and I was able to fully install it from /moodle. I left it at that for the night and came back to it today. I now cannot access any php files through that same link. The page just times out. Could it be from rebooting my machine? Apache is running but still won't load anything.

Thank you in advance for the help!

in flag
Have you checked that the database is not causing the timeout? If it cannot return data correctly, this may be resulting in the timeout. Restarting Apache with a `sudo service apache2 restart` may also help a bit …
Score:0
cn flag

ho,

There's quite a few reasons this might not work...

Start with checking /var/log/apache2/error.log (or the custom log file name if you set one).

You might also find you can enable debuging / error messages in moodle itself to see what the problem is, but I'm not familiar with it.

Generally getting a completely blank page with no timeout / error means that the application (moodle in your case) is kicking an error but not displaying it on the browser.

erauso avatar
cc flag
I appreciate the comment, but it is timing out. As if I didn't even have apache installed. It has to be something with apache I would assume because even a test config file of phpinfo won't load.
kiwichrish avatar
cn flag
OK.. What does: sudo apachectl configtest give you? That'll validate the config of Apache... And / or sudo systemctl status apache2
erauso avatar
cc flag
apachectl config test: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message Syntax OK
erauso avatar
cc flag
systemctl status apache2 is up and running as well
kiwichrish avatar
cn flag
Hmm, is apache listening on an odd port maybe? sudo ss -tulnp | grep apache2 to check it's actually listening on port 80 (?). Also, try to curl from localhost on the machine running apache. ie: curl http://127.0.0.1/moodle and see if the issue is between the vm/host/container running apache and your browser.
erauso avatar
cc flag
sudo ss -tulnp | grep apache2:tcp LISTEN 0 511 *:80 *:* users:(("apache2",pid=6453,fd=4),("apache2",pid=6452,fd=4),("apache2",pid=6451,fd=4),("apache2",pid=6450,fd=4),("apache2",pid=6449,fd=4),("apache2",pid=6448,fd=4)). is the output
kiwichrish avatar
cn flag
OK, so it's listening on port 80.. so that curl command should work.. Or give you an error. Either way it's progress. :-) (I note the comment thing messed up the URL in that comment, the curl command needs the whole url http : // 127.0.0.1/moodle etc.
erauso avatar
cc flag
I got an error with the curl command " Failed to connect to 127.0.0.1 port 443 after 0 ms: connection refused
kiwichrish avatar
cn flag
You're not listening on port 443 according to the output from ss... So that would make sense.. http: not https: ?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.