Drupal Version: 8.9.20

PHP Version: 7.4.33

OS: CentOS Linux 8

I'm having a problem on my test server that I can't figure out. Everything is working fine on my development and staging environments (locally) and on my live environment which is on the same server as my test server. Both live and test use the same Apache config. I have an admin panel that you see when you login as admin, clicking some pages of the admin panel works but some other give a white page with a "Status code: 500" error message.

The pages with the errors load multiple views and if I delete the views from the page the basic page loads ok. I thought this could be a PHP memory issue but I have 2048M assigned as PHP memory so I don't think it is running out of memory. The live site works with the same limit.

I am getting some errors in the error_log file, but I don’t understand what they mean, they look similar to this:

[23-Sep-2024 18:57:22 UTC] PHP Deprecated:  Return type of Drupal\Core\Render\Markup::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/darkstar/public_html/mysitename.uk/core/lib/Drupal/Component/Render/MarkupTrait.php on line 71

My hosting company say its a problem with the PHP settings in my .htaccess file but I don’t understand how to fix. I’ve tried copying the .htaccess from the live site to the test site but I still get the 500 error.

I really want to upgrade Drupal but this issue is preventing me from doing so. Any suggestions on how I can fix this are very much appreciated as I’m very stuck. Thanks!