IIS PHP FastCGI 500 error when running with PHP 8.2 instead of PHP 7.4

60 Views Asked by At

I host multiple PHP (WordPress) sites on a Windows 2019 Server with IIS 10.

I have PHP 7.4 and PHP 8.2 installed on this server.

I have one site which works fine when running with PHP 8.2 and FastCGI.

I have another site, which is supposed to be configured exactly the same way, which is running fine when configured with PHP 7.4 and FastCGI, but generates error 500 on every request as soon as I configure it with PHP 8.2 and FastCGI.

When I look at IIS log file, I see errors as 500 0 3221225477, and the error code 3221225477 is 0xC0000005 in hex, which on Windows is: define STATUS_ACCESS_VIOLATION.

I am quite disappointed as this appears one week ago, and I did not make any change on the server.

I have already spent a lot of time to compare the configuration of the two sites, and cannot see any difference.

Any advice on how investigate to find the root cause of the error and fix it will be greatly appreciated.

*** added after first answers received ***

WP themes and plugins installed in the site which runs fine in PHP 8.2 and the one which generates error 500 in PHP 8.2 are exactly the same and all are exactly in the same versions.

I have enables Failed Request Tracing and click here to see what I get when a 500 error is generated.

Also, if I network deactivate all themes and all plugins, and runs with PHP 8.2, I still get 500 errors on the main site of the network, but the other sites are displayed with no error.

Please advise.

I finally got it.

There was no error in PHP log but the Windows Event Viewer finally give me a hint.

The 500 error was due to a memory exception in the OPCache PHP optimization module.

I stopped IIS, cleared the OPCache cache directory, adjusted some OPCache settings, and everything is back on track.

0

There are 0 best solutions below