Upgrading from 3.63 to 3.10 Error 500

Upgrading from 3.63 to 3.10 Error 500

by Rick O -
Number of replies: 10

I have a Windows install of Moodle and I tried to upgrade from 3.63 to 3.10. I renamed my moodle folder to moodle-old, copied the new moodle folder and copied all files in the root of moodle-old folder, but get the following error:

currently unable to handle this request. HTTP ERROR 500


Average of ratings: -
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Do you know which version of PHP you have? It should be PHP 7.2, 7.3 or 7.4.

Check the web server error logs to see if they contain anything that might help.

If it still doesn't work try adding the debug lines to config.php.

In reply to Leon Stringer

Re: Upgrading from 3.63 to 3.10 Error 500

by Rick O -
IIS is using PHP 7.2.14
I tried it again this morning and it seemed to work. I think I may of missed some files.
I updated PHP to 7.4.13 and got the error 500 again.

The PHP error log displays the following many times:
HP Warning:  PHP Startup: Invalid library (appears to be a Zend Extension, try loading using zend_extension=php_opcache.dll from php.ini) in Unknown on line 0

php_opcache.dll is enabled.
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Rick O -
I have set the following in php.ini:

zend_extension=php_opcache.dll
opcache.enable=1
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

So is there still a problem? Is the error message still being logged? That "Invalid library" error sounds like it's being caused by a problem with a PHP extension, maybe the extension=/zend_extension= is wrong, or maybe the extension depends on something that's not installed.

Is OPcache definitely working? Under Site administration ▸ Server ▸ PHP info do you see the following near the end of the page:

Cropped screenshot of PHP info showing "Opcode Caching: Up and Running"; "Optimization: Enabled".

You can attach your php.ini to your reply if you would like us to check it (please attach the file don't paste the text).

In reply to Leon Stringer

Re: Upgrading from 3.63 to 3.10 Error 500

by Rick O -
When I change to PHP 7.4.13 on IIS, it immediately goes to Error 500. I can't even run the php.ini.
I recently added the SQL Server Extension DLL files (php_pdo_sqlsrv_74_nts_x64.dll and php_sqlsrv_74_nts_x64.dll). Even before adding these extensions, it would go to error 500.

I have tried commenting out zend_extension = php_opcache.dll. I have also tried adding and commenting out extension=php_opcache.dll
All the dll files are in the ext folder.

Every time I made a change, I restarted the IIS services and tested.

I am including the php.ini file for 7.4.13
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

In php.ini you should have zend_extension = php_opcache.dll only, remove extension=php_opcache.dll (or comment it out with a ';' prefix).

If you're still seeing error 500 try running PHP at the command line and see if it shows any error. For example if PHP is installed in C:\PHP:

  1. Open a command prompt window.
  2. Enter the command cd C:\PHP (or whichever folder PHP is installed in on your server).
  3. Enter the command php -v.

For example on my server with PHP 7.4.16 in C:\Program Files\PHP\7.4.16:

Output of 'php -v' on Windows Server 2016 with PHP 7.4.16.

On your server you may get an error – either in the output or in a popup window – which might help identify the problem.

Average of ratings: Useful (2)
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Usman Asar -
Picture of Plugin developers Picture of Testers
Rick, can you paste the 500 error code page here? as 500 does points to PHP but there must be specifics that you may be missing.
secondly, have you downloaded the correct version? (Non-thread safe)
finally, how did you upgraded the PHP in IIS? manually or using PHP manager?
In reply to Usman Asar

Re: Upgrading from 3.63 to 3.10 Error 500

by Rick O -
The web site only displays the following:
Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

Installed PHP 7.4.13 x64 using Microsoft Web Platform installer as was installed 7.2 originally.
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Usman Asar -
Picture of Plugin developers Picture of Testers
Rick, using WPI is as same as using script installer on shared hosting, you should have installed PHP manually to avoid any errors, anyway, you can try using PHP Manager or setup manually. if you need assistance in setting up PHP using either methods you can watch the tutorials HERE
In reply to Rick O

Re: Upgrading from 3.63 to 3.10 Error 500

by Usman Asar -
Picture of Plugin developers Picture of Testers
Also, I remember, installing PHP through WPI will add to server level, you may have installed PHP 7.2 using WPI prior to setup website. anything added AFTER IIS setup will automatically inherit from server level, anything added later, you have to select correct PHP version at site level as well and this would be happening, you after installing PHP 7.4 assumed it should work straight away at site level as well, this does not happen automatically, you have to make changes at site level as well.