Blank page on localhost/moodle

Blank page on localhost/moodle

by Thoriq Adillah -
Number of replies: 25
Hi, after a while i revisit moodle to update my plugin, and i want to install it again. I don't know why, but every time i want to fresh install moodle i know it's not gonna be simple, like this one.

So i followed this instructions:
https://docs.moodle.org/403/en/Step-by-step_Installation_Guide_for_Ubuntu

But i install the moodle deps using dnf with sudo dnf install moodle. But the moodle project itself is from public mirror github repo. And i use docker for the database

Problem is, when i visit localhost/moodle, it shows blank page. As far as i remember, it should shows installation page, and on that page i will configure the moodle. But no, it's nothing, juts blank. How do i fix this?
Average of ratings: -
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Put a test.html file in the Moodle code directory, where the config.php is, and visit http://localhost/test.html.

It that doesn't render the test.html, then your web server is not set up properly. Study its log files. If the test.html shows, then create a phpinfo.php file with content
<?php phpinfo(); ?>
and see whether you see your computer's PHP environment displayed.
In reply to Visvanath Ratnaweera

Re: Blank page on localhost/moodle

by Thoriq Adillah -
i have tried to create test.php that contains `<?php phpinfo(); ?>` on /var/www/html, and when i visit http://localhost/test.php it's working, so the server should be working correctly.

http://localhost/test.html is not found because it's inside moodle directory, no?

the problem i think rendering the moodle directory, i don't know which part though. Many forum told me that maybe apache can't read the content, so it did not render anything, but i already set the permission to be 777, and it's still nothing
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Is your Moodle code directory, where the config.php is, /var/www/html/ or /var/www/html/moodle/? If your Moodle should come up as http://localhost/ you should configure the DocumentRoot of your web server accordingly. As it is, your Moodle could be at http://localhost/moodle/. Don't forget the line $CFG->wwwroot should match that. Aren't these things in the documentation page you are following?

In reply to Visvanath Ratnaweera

Re: Blank page on localhost/moodle

by Thoriq Adillah -
my moodle directory is /var/www/html/moodle

No, the thing is, `config.php` will come up after the installation process completed right?
From the documentation, last time i did that, after the 6th step done, and then i open http://localhost/moodle, it would show the installation page, and after the installation process completed, the `config.php` will be there. But, the installation page is never there to begin with, so I think `wwwroot` on config is not relevant, because there is no `config.php` for fresh moodle
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Good point! I should have said "Moodle code directory, where the config.php will be put". But as you say, since there is no config.php, you don't know where it should be put. Next time I will say, Moodle code directory, where the config-dist.php is".
wink
In reply to Visvanath Ratnaweera

Re: Blank page on localhost/moodle

by Thoriq Adillah -
Even with config.php present it's still not showing the installation page
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Do you really read those documentation? Once Moodle created the config.php the installation is over!
In reply to Visvanath Ratnaweera

Re: Blank page on localhost/moodle

by Thoriq Adillah -
Yes, i understand that. Maybe i put it in the wrong way
Even with config.php present, it's still blank, it's nothing.
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Then listen to Ken, "Issue you are experiencing now indicates you need to look at server logs ... which would/should be in /var/log/httpd for web server - and specifically the error_log"
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Ken Task -
Picture of Particularly helpful Moodlers
dnf usage indicates CentOS 9 stream, or Rocky 8 or 9, or AlmaLinux 8 or 9.
Which?

Used dnf for the dependencies ... PHP + extensions, MySQL/MariaDB.
Those versions are?
 
Then you followed the installation guide for Ubuntu.

You  must have had to adjust those directions for Ubuntu a little since your platform isn't Ubuntu.

And those directions appear to be really intended for users that want to maintain their own local git repo of moodle core code ... the part about acquire in /opt/ first then copy to document root is kinda the long way IMHO!

By far the best way to install and maintain a moodle is via git - command line only.
https://docs.moodle.org/403/en/Git_for_Administrators

Issue you are experiencing now indicates you need to look at server logs ... which would/should be in /var/log/httpd for web server - and specifically the error_log - or if your php setup is set to log errors in the directories where they occur ... then
cd /path/to/moodle/code/
find ./ -name error_log

'SoS', Ken



In reply to Ken Task

Re: Blank page on localhost/moodle

by Thoriq Adillah -
So i use fedora for my pc, and i wanted to update my plugin because after a while, people post an issue on my repo, so i want to fix them.

All of the deps are for php 8.2

I used the ubuntu guide because the previous 3 attempts for fresh install was working, but with their own unique problem, i don't know why. So i attempted to use the guide again, maybe i need to take a look at your suggestion

For the error on httpd
[Fri Jun 02 21:58:02.308453 2023] [proxy_fcgi:error] [pid 40678:tid 40756] [client 127.0.0.1:41370] AH01079: failed to make connection to backend: httpd-UDS, referer: http://localhost/moodle/install.php

To be honest, i already have my old moodle, but i recall that i have uninstalled httpd before, and reinstall it today or yesterday, i forgot

For the error on the php setup, i couldn't find it
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Ken Task -
Picture of Particularly helpful Moodlers
You might want to check out:
https://docs.fedoraproject.org/en-US/releases/eol/
and
https://docs.fedoraproject.org/en-US/releases/f39/

Would think, to make your programming easier, one would want to use a long term support operating system.

The error log reference you found is dated June 02 ... that's a very old reference.  But it does indicate you were having issue with installing as it did give info on a proxy setup and a referral:
http://localhost/moodle/install.

All in all, you might be better off using Ubuntu as they have rep. of being on leading edge/bleeding edge where RH and Fedora tends to be conservative in that regard.   Besides that think you might noticed that most Moodle docs are written for Ubuntu.

Since your purpose is to fix your own plugin the /opt/ setup for core repo would be the place you'd push your plugin updates to ... then to see them via web interface, copy to /var/www/html/moodle/. or in the case of git, you'd be doing a git pull from your own /opt/ repo.

Anyway ... basic concepts ... fewest moving parts - longer term support.

'SoS', Ken




In reply to Ken Task

Re: Blank page on localhost/moodle

by Thoriq Adillah -
Oh i totally didn't see the month and year lol. So it was the error for the last install i did. Sorry for that
So that basically i have no error then?

For ubuntu part, what if i want to use fedora? Because this is my setup for the last 2 years, and it's super stable and i don't want to install something else just because particular software doesn't work. And yes, i have the latest fedora
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
But I thought your Fedora installation was abandoned > Error on fresh installation.
In reply to Visvanath Ratnaweera

Re: Blank page on localhost/moodle

by Thoriq Adillah -
It has been resolved, and i have done the work since then. Now i want to install moodle again because somehow the last moodle i installed is not working. Maybe because i did something that i was not aware of
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> It has been resolved, and i have done the work since then.

Then pl. close the thread. See site policy on how to do it here on moodle.org.

> Now i want to install moodle again because somehow the last moodle i installed is not working.

That "somehow" needs to be investigated, ideally in the old discussion. You know, it may pop up here, if not settled there.
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Ken Task -
Picture of Particularly helpful Moodlers
"So that basically i have no error then?"
Now how in the world would anyone on this forum know the answer to that question?

"super stable" - yeah, a localhost/locallan only box with any distro of Linux could be considered that.  But I don't think I'd open it to the internet if the distro wasn't getting updates of any kind.

So Fedora has upgrade in place script?   Or do you re-install everything to get the latest Fedora - which would mean also new PHP version, new PHP version extensions, new MySQL/MariaDB, new Apache etc.   It's my preferences that I don't rebuild a new box every year - got other things to do!

As far as moodle is concerned ... as long as the OS has compat PHP + extensions, compat MySQL/MariaDB, and a compat web service (nginx/apache etc.) for the version of Moodle you want to run, then your OK ... and I'll say again ... best way to install and maintain (update/upgrade) moodle code is git.

https://moodledev.io/general/releases
https://docs.moodle.org/403/en/Git_for_Administrators

'SoS', Ken


In reply to Ken Task

Re: Blank page on localhost/moodle

by Thoriq Adillah -
Nope, i upgraded my fedora using their upgrade script from the fedora docs.

Now, even though i installed moodle using dnf, the moodle itself is just a php project. I can replace them with moodle from git, and i did tried using moodle from git, it's still blank page. It just happened that i uninstalled php on my pc because it spit some warning and can't be bother to fix it. Even though the warning can be ignored, it's a bit annoying. So i tried the naive way, just uninstalled it, because i have no project that uses php anyway

And then someone posted issues on my repo, so i look up on the internet that i can install moodle with dnf, because i guess it's gonna be simpler, and php and it's extension are included in the deps. And then here i am, still looking for the answer


In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Ken Task -
Picture of Particularly helpful Moodlers
"Nope, i upgraded my fedora using their upgrade script from the fedora docs."

That's a nice addition that didn't exist when I was using Fedora.

"look up on the internet that i can install moodle with dnf"

Mind sharing that resource?   Can't seem to find that via Google.

Bitnami AMP stack?

What does your dnf repolist look like?

Also would think that a blank page would at least show something in server logs ...
but you could use the debug lines from config-dist.php and put them into the config.php file to see if moodle will report any useful info.

'SoS', Ken
 
In reply to Ken Task

Re: Blank page on localhost/moodle

by Thoriq Adillah -
For the dnf, i was Just thinking maybe if moodle can be installed using package manager, that would be great. And sure enough when i tried to search it, there is a title somewhere on my search result about it, so i look up moodle on the dnf and it's there

And i am not using Bitnami AMP stack, i just installed php and apache and tried to figured it out, just like the last time i did. But apparently i am struggling now, maybe i will give a try using xampp or lampp like the first time i did.

But I don't know what you mean about AMP stack, maybe what i did this time is AMP stack
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Ken Task -
Picture of Particularly helpful Moodlers
Hey, you've lost opportunity to 'advertise' your moodle plugin!

So I'll do that for ya:
https://github.com/thoriqadillah/moodle-qtype_essaysimilarity
99.5% PHP .5% CSS

And your reason for attempting a moodle setup is this:
https://github.com/thoriqadillah/moodle-qtype_essaysimilarity/issues/23
Hmmmm .... submitter is a well-known moodle developer.

Since your code is on the github I would assume installation of a test moodle platform via git would be a no-brainer for ya.

'SoS',
Ken

In reply to Ken Task

Re: Blank page on localhost/moodle

by Thoriq Adillah -
Thanks for promoting my plugin, that's very nice of you.

Yep, git was never a problem for me, i have tried using moodle from git, but no luck so far. Maybe i will using xampp/lampp for the http server rather than setting it on my own, just for simplicity i guess, and see if it's work
In reply to Thoriq Adillah

Re: Blank page on localhost/moodle

by Ken Task -
Picture of Particularly helpful Moodlers
Rather than this forum on installing and upgrading, maybe your post/questions should be in the developers forum.

Setting Up Moodle for Development
https://moodle.org/mod/forum/discuss.php?d=386596

'SoS', Ken

In reply to Ken Task

Re: Blank page on localhost/moodle

by Thoriq Adillah -
Okay then, maybe I'll close this thread and try to go to that forum. Thanks