Server upgrade questions

Server upgrade questions

by Steve Morrison -
Number of replies: 8

Moodle 3.7.7. site has been running very well for several years on my current vps. php version 7.3.3 sql version 5.6.51. Host renewal time has come around again. Host is changing me over to an nvme vps with alma linux. php version will change to 7.4. mysql will change from 5.6.51 to 8.0. these are the minimums that the new server will support. other than changing a path in one of my cron lines to 7.4 php are there any issues that you know of that may arise? one concern that I have is the database conversion to 8.0. I have held off on updating from 3.7.7 due to my phobia on the database upgrade. help, opinions, advice?

       Thanks!! Steve

Average of ratings: -
In reply to Steve Morrison

Server upgrade questions

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
PHP 7.4 has been end-of-life / unsupported for over two years and the more recent versions of Moodle won't run on it. So that's not a good start sad
In reply to Steve Morrison

Server upgrade questions

by Ken Task -
Picture of Particularly helpful Moodlers

Resources

Mr. V's chart:
http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases

Moodle Releases
https://moodledev.io/general/releases

"I have held off on updating from 3.7.7" ... maybe too long ... catching up to ya now! sad

If you notice in Mr. V's chart ... mysql required version doesn't change much from 3.7 upwards, but PHP does.

Since you have Alma Linux ... must be at least version 8 ... right?

What does your package manager (dnf) show for available php versions?

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Server upgrade questions

by Steve Morrison -

Well we went sideways......Upgrade to Moodle 3.9.25 went well. Host migrated me from a server with PHP 7.3 and MYSQL 5.6 to a server with PHP 7.4 and MYSQL 8.0. I am now getting an internal server error message. The plan seemed too perfect. 

Any advice on where to start would be greatly appreciated. 

    Thanks!! Steve

    

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@*****g.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. 

This is what I see in the Error log: 

[10-May-2025 19:46:01 UTC] PHP Warning:  require(/home/*****/public_html/admin/cli/../../config.php): failed to open stream: No such file or directory in /home/*****/public_html/admin/cli/cron.php on line 33
[10-May-2025 19:46:01 UTC] PHP Warning:  require(/home/*****/public_html/admin/cli/../../config.php): failed to open stream: No such file or directory in /home/*****/public_html/admin/cli/cron.php on line 33
[10-May-2025 19:46:01 UTC] PHP Fatal error:  require(): Failed opening required '/home/*****/public_html/admin/cli/../../config.php' (include_path='.:/opt/cpanel/ea-php73/root/usr/share/pear') in /home/*****/public_html/admin/cli/cron.php on line 33
In reply to Steve Morrison

Server upgrade questions

by Ken Task -
Picture of Particularly helpful Moodlers

Cron job is setup outside of moodle in cPanel or other panel you have.

Check the path to php and the full path to your moodle code.

this line is wrong:

/home/*****/public_html/admin/cli/../../config.php

If your code is in /home/******/public_html/ then
the full path to the cron.php file would be
/home/******/public_html/admin/cli/cron.php

Cron job setup must first begin with the path to php-cli
of the version of php you want to run which in your case
**could** be in something like /opt/php74/bin/php

If cPanel, there is an icon for Easy Apache or for MultiPHP.   Check those out.

Official docs:

https://docs.moodle.org/500/en/Cron

'SoS', Ken

In reply to Ken Task

Server upgrade questions

by Steve Morrison -
it appears that the host has PHP 8.0 on the server instead of 7.4. As I look in my easy Apache I see this little version issue. The home directory structure on the new server appears to be laid in identical to the structure on the old functioning server. I had figured at first that I had found the issue when I changed the PHP path. given the V8.0 of PHP instead of 74 the path would definitely be wrong. Host should be changing PHP versions to 74. Fingers crossed. Will update shortly. Ken, as usual you are an asset to the community.
In reply to Steve Morrison

Server upgrade questions

by Ken Task -
Picture of Particularly helpful Moodlers

Refer to the chart again - the row for 3.9

Upgrade to Moodle 3.9.25 is that your current version?

PHP min/max

Also look at 8.0 max in chart - shows only 3.11 and 4.0

So if I am correct, with 8.0 of PHP, you must upgrade from 3.9 to at least 3.11.

Questions:

does your new hosting have a Terminal icon in cPanel?

and does your new hosing have a Git icon in cPanel?

If both of those are true, we need to talk via PM or direct email!

Additional info:

https://moodledev.io/general/releases/3.11

  • PHP extension sodium is recommended. It will be required in Moodle 4.2. For further details, see Environment - PHP extension sodium.
  • PHP setting max_input_vars is recommended to be >= 5000 for PHP 7.x installations. It's a requirement for PHP 8.x installations. For further details, see Environment - max input vars.

'SoS', Ken

 

In reply to Steve Morrison

Server upgrade questions

by Steve Morrison -
That chart is awesome!! Thank you!!
I have now seen the path that needs to be taken. My current host is upgrading my service on this renewal as I am running on an obsolete server. mysql 5.6 and php 7.3 are the highest versions that the current server will support. the new server supports mysql 8.0 and php 7.4 as a minimum. we can upgrade to later versions from there once the migration is done. Moodle 3.7 appears to work with php 7.3 as the latest php version and will work with mysql 8.0. so........I have done a successful moodle upgrade to 3.9.25. it would appear that when the migration is done that php 7.4 will be good and mysql 8.0 will be good. at that point I can upgrade to 4.1 LTS and following that update the php to 8.0.
If I am interpreting the chart correctly, that should work.
Thanks again for posting that chart!! extremely helpful.
Steve
In reply to Steve Morrison

Server upgrade questions

by Steve Morrison -

  Up and running on the new server. currently on Moodle 3.11.18. PHP version 8.0. As mentioned, went into the new server on 3.9 and PHP version 7.4. ran into issues with 500 errors. Placed a phpinfo.php file into public_html to see if I could at least read php info from the web. no luck. It was found that the php manager had created an htaccess file listing php 73 from the old server. Copied the htaccess from public_html into the home directory, and now we have a webpage!! on to working bugs out. no matter what cron wouldn't run. Not failures, just wouldn't run either from the cli or from the cron no matter what I tried. was able to temporarily unlock run cron from browser to test. cron ran with no errors. ask logs in moodle verified. contacted host and asked. It seems that under php 7.4 mysqli will not install. Host said if I upgrade site software to run under PHP 8.0 mysqli would install. funny though, even with PHP 8.0 the php ini editor will still creat an htaccess file for PHP 7.3. definitly can't use the editor. Upgraded to Moodle 3.11.18, changed over to PHP 8.0, done a quick edit on the cron php path. Cron took right off and started doing it's thing. Now to see if the nameservers stay propogated. they have slipped back on me once. had to contact the host. evidently they had a fat finger moment on the nameserver entries. I can't thank the people here enough. I have to say a special thank you to Ken Task. When I had troubles on my old server he stepped up to the plate and helped me get things going again. He taught me a bit while he was at it. This time, he again was there to assist, and again he taught me another few things. Ken, I owe you a great debt of gratitude. your sharing of knowledge is appreciated more than you could ever know. Thanks again!! Steve

Average of ratings: Useful (1)