I read this a while ago and my first thought was Android is not the right place for a web-server running Moodle.
My second thought was - why not? A modern phone is really a multi-core CPU computer which is always on and always at hand. On a local network it can be accessed from any device on that network.
I experimented a few times, giving up as I met problems. However I now have a Moodle server running on my phone.
Just because you can do something doesn't mean you should. Flaky is the best description with the Moodle site often showing a directory listing.
I didn't root my phone but used Termux, an Android Linux emulator with Apache, PHP 7.4 and MariaDB
. The php extensions are limited in the Termux repository but enough are there to meet minimum requirements. Termux also is single user so no chmod or chown required and the file system is non standard. Still you can configure PHP and SQL
settings as for a CLI of Linux.
It all runs very slowly and benchmarks at around 900 with slow processor and login. Pretty much useless but maybe it can be improved.
I am still not sure when a Moodle server running on a phone would be useful but the OP
had a user case. However this install could not be built on a PC and transferred to Android. The time investigating this has not been wasted as Termux is now used for ssh access to my servers.