Hi All,
I upgraded our 4.5 site to the new 5.0, and everything runs smoothly. However, this new front controller / Moodle router feature will be compulsory from 5.1 onwards, so I figured I would deploy it now (given that it was there in 4.5 but not deployed for me anyway).
Whatever I do does not work smoothly. It appears to fail on several pages, yet several others work. The test page that always fails is the home page when clicking the home icon. It just throws a 404 error. If I try to click on My Dashboard, it does the same 404 error, but it says /my/ instead of the /?redirect=0 in the image below.
Disabling or reverting the changes, and it works perfectly fine. I am using the latest version of Apache on Ubuntu 22.04.5 and have followed the Moodle documentation here - https://docs.moodle.org/500/en/Configuring_the_Router
I have placed the FallbackResource directive into the Apache Site Configuration File.
Thinking it was our current mod_rewrite rules to hide Moodle's Internal Paths for security, disabling these rules/engine did not resolve the issue. They are as follows. These allow the Security Checks inside Moodle to report back successfully for unexposed internal paths.
Per the documentation, I have added the "routerconfigured" directive and set it to true in config.php.
The errors in the Apache error log file for the specific site show the 404 error as follows:
[Wed Apr 16 21:57:43.375310 2025] [php:notice] [pid 62903:tid 62903] [client 103.76.165.206:0] 404 Not Found
Type: Slim\\Exception\\HttpNotFoundException
Code: 404
Message: Not found.
File: /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/Middleware/RoutingMiddleware.php
Line: 76
Trace: #0 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/Middleware/RoutingMiddleware.php(44): Slim\\Middleware\\RoutingMiddleware->performRouting()
#1 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/MiddlewareDispatcher.php(121): Slim\\Middleware\\RoutingMiddleware->process()
#2 /opt/sites/lms.tcsc.academy/lib/classes/router/middleware/uri_normalisation_middleware.php(59): Psr\\Http\\Server\\RequestHandlerInterface@anonymous->handle()
#3 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/MiddlewareDispatcher.php(121): core\\router\\middleware\\uri_normalisation_middleware->process()
#4 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/Middleware/ErrorMiddleware.php(76): Psr\\Http\\Server\\RequestHandlerInterface@anonymous->handle()
#5 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/MiddlewareDispatcher.php(121): Slim\\Middleware\\ErrorMiddleware->process()
#6 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/MiddlewareDispatcher.php(65): Psr\\Http\\Server\\RequestHandlerInterface@anonymous->handle()
#7 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/App.php(199): Slim\\MiddlewareDispatcher->handle()
#8 /opt/sites/lms.tcsc.academy/lib/slim/slim/Slim/App.php(183): Slim\\App->handle()
#9 /opt/sites/lms.tcsc.academy/lib/classes/router.php(310): Slim\\App->run()
#10 /opt/sites/lms.tcsc.academy/r.php(55): core\\router->serve()
#11 {main}, referer: https://lms.tcsc.academy/admin/search.php
I've checked to ensure those files (r.php, RoutingMiddleware.php, etc.) all exist, and they all do, so it's not them, as far as I can tell. Line 76 of that file is just where it throws the exception.
I don't have any guidance on having to install a specific PHP component or other package for Slim, so no action taken there.
I'm stumped, so I'm contacting you all to see if anyone has managed to get this working. For now, the router is disabled and the site works, but given its compulsory nature coming in the next 5.1, I'd like to ensure it's all working now.
Appreciate the assistance!
Cheers,
Ray.