LMSouq
moodle-core Open

Moodle 5.1.x upgrade ERR_TOO_MANY_REDIRECTS

CH
Chris Walsh
1 month ago
3 views
Problem Description
I am upgrading Moodle from 5.0.1 to 5.1.3+ (current latest version). This upgrade includes the [Code directories restructure](https://docs.moodle.org/501/en/Upgrading#Code_directories_restructure) where the we must now (ideally) point DocumentRoot to the **public** subfolder of the moodle web package (this is so that some moodle php files can reside *outside* the web view). I am running PHP 8.4.18 both under apache and in the terminal. I am running the site on a WHM/cPanel combo and after researching, I should be able to simply replace the **public_html** directory in the cPanel home directory with a symlink to the **public** folder in the new moodle package (and similarly update the existing www symlink likewise). The site works perfectly when using symbolic links pointing to the 5.0.1 version (package root folder) but when I swap over to the 5.1.3+ version (sym link to the package's public subfolder), it attempts to start the upgrade and then I get ERR_TOO_MANY_REDIRECTS as the site keeps redirecting between **./admin/index.php** and **./install.php**. I have tried clearing caches in moodle: ``` rm -rf moodledata/cache/* rm -rf moodledata/localcache/* rm -rf moodledata/sessions/* ``` I have tried commenting out a redirect line in **./admin/index.php**. I've created a test php file to output the value of `$CFG->dirroot` and it is correctly going to `/home/<myusername>/moodle/moodle_5.1.3` Here is my home directory: ![enter image description here](https://i.sstatic.net/IB5Ar0Wk.png) Here is the folder structure showing the moodle folder containing the previous and new moodle versions: ![Directory listing showing moodle folder containing moodle_5.0.1 and moodle_5.1.3 with the latter containing a public subfolder.](https://i.sstatic.net/WgR9kkwX.png) The redirects as I say are between **./index.php?lang-en** and **./admin/install/php**: ![Listing of google dev tools showing redirets between install.php and admin/index.php](https://i.sstatic.net/pBgavZHf.png) Any advice on what else I should try? Thanks

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base