Error after updating PHP

Error after updating PHP

by Stuart Hoaen -
Number of replies: 8

My Moodle site is running Moodle version 3.1.1 on IIS 8.5 with PHP 5.5.16 and MySQL 5.6.20.


I am trying to update PHP to version 5.6.26 but find when I do so, Moodle fails to load giving the following error:


"The page cannot be displayed because an internal server error has occurred."


I know that my PHP configuration on IIS is good as I also have a Wordpress site on the same server which is works fine on newer version of PHP.  If I revert PHP to the previous version (5.5.16) Moodle then works ok.


I have checked every log I can find but can't find the cause of the problem.  Does anyone have any clue what the issue might be please?


Many thanks

Average of ratings: -
In reply to Stuart Hoaen

Re: Error after updating PHP

by A. Obeid -

Hi, did you restart the Server (IIS) after updating php?

In reply to A. Obeid

Re: Error after updating PHP

by Stuart Hoaen -

Thanks for your reply.


I did yes.  And as I say my Wordpress site worked fine on the new version of PHP after restarting IIS...

In reply to Stuart Hoaen

Re: Error after updating PHP

by Albert Ramsbottom -

Is there a reason why you are upgrading PHP??


Albert

In reply to Albert Ramsbottom

Re: Error after updating PHP

by Stuart Hoaen -

To prepare for Moodle version 3.2 as it is required.



In reply to Stuart Hoaen

Re: Error after updating PHP

by Usman Asar -
Picture of Plugin developers Picture of Testers
Stuart, have you copied over the exact same php configuration file? that you've been using with PHP 5.5?
Server restarts are not required when upgrading PHP in IIS, just recycling application pools does the job.

There is a tutorial on setting up Moodle on IIS, where good time is spent on setting php for moodle, have a look here and see if that helps
http://blog.academictools.org/2015/12/installing-moodle-on-microsoft-windows.html

if you haven't already, and can, I recommend using PHPManager extension to install and setup PHP on IIS, it makes the job lot easier, so for that watch 2nd video on blog post.

In reply to Usman Asar

Re: Error after updating PHP

by Stuart Hoaen -

Hi Usman


Thanks for your post.  I have triple checked my PHP ini file and it is correct.


I tried installing PHP Manager as per your video (great site by the way) but it fails to install...



In reply to Stuart Hoaen

Re: Error after updating PHP

by A. Obeid -

Hi Stuart,

i am using "Web Platform Installer 5.0" for the Windows Server and there i get PHP 7 that work fine with moodle 3.

I also delete all old php versions.


In reply to Stuart Hoaen

Re: Error after updating PHP

by Usman Asar -
Picture of Plugin developers Picture of Testers

First thing, do not use Web Application Installer to install PHPmanager, it wont simply work, if base settings arent correct, also Web application installers have very old versions of scripts.

As there is PHP settings already in, just go to Handeler Mappings, and remove all PHP that is already there, in addition, removing the PHP config files from PHP folders. (liek you have just unzipped the PHP folder), reason could be, as you MAY have paths without double quotes, and in windows platforms, any path with blank spaces in between should always be included in double quotes.

Also, there are updated version for PHP Manager mentioned on site, for Server 2012 an Server 2016, you may as well want to download and use them.

This will install the PHP Manager for sure.


Just a tip, if you have more than one scripts running on server, like you mentioned WordPress and moodle, you may want to keep PHP in their respective folders (means separately) for PHP for moodle will have slightly different settings, like  Zend OpCache, where you may not need it for WordPress, and using WinCache for WordPress where you may not use it for moodle.

Average of ratings:Useful (1)