最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

debug - Site throws 500 error after upgrading from PHP 5.6 to 7.X

programmeradmin2浏览0评论

If I try to upgrade to PHP 7 or up (from 5.6), I have one site that is throwing a PHP error.

I have tried uninstalling all plugins and activating the Twenty Twenty theme before changing PHP version. No dice.

Is there a setting in the database or core that would be effecting this? I also tried a default .htaccess file.

EDIT: WP debug.log says:

[10-Mar-2020 23:35:45 UTC] PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /path/public_html/wp-includes/formatting.php on line 1600
[10-Mar-2020 23:35:45 UTC] PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /path/public_html/wp-includes/version.php on line 1

But this seems unrelated, right? The site is having i/o issues as well.

If I try to upgrade to PHP 7 or up (from 5.6), I have one site that is throwing a PHP error.

I have tried uninstalling all plugins and activating the Twenty Twenty theme before changing PHP version. No dice.

Is there a setting in the database or core that would be effecting this? I also tried a default .htaccess file.

EDIT: WP debug.log says:

[10-Mar-2020 23:35:45 UTC] PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /path/public_html/wp-includes/formatting.php on line 1600
[10-Mar-2020 23:35:45 UTC] PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /path/public_html/wp-includes/version.php on line 1

But this seems unrelated, right? The site is having i/o issues as well.

Share Improve this question edited Mar 10, 2020 at 23:43 Lime asked Mar 10, 2020 at 23:12 LimeLime 1286 bronze badges 2
  • 1 You may have to turn on debugging and check either the debug.log or the server logs in order to determine more information. – butlerblog Commented Mar 10, 2020 at 23:24
  • 1 When upgrading to 7 were all related php modules also upgraded? Are appropriate handlers present in your http server config? Mine has handlers for php5, php7.2 and php7.3 so I can switch between versions. But if you have handlers for (addhandler in apache) for v5 and you're running 7 you might have issues. I'm just plucking straws out of thin air here. :) – Admiral Noisy Bottom Commented Mar 11, 2020 at 1:27
Add a comment  | 

2 Answers 2

Reset to default 1

try doing wp_debug true and if the issue is of memory allocation try allocating memory in the wp-config

define('WP_MEMORY_LIMIT', '64M');

If it is not fixed try increasing the memory limit.

'500' errors are really hard to debug. It's sort of a 'something went wrong but I got no details that will help you figure out what went wrong'. Even the error message that you put in your question is not that helpful. And any help via the googles/bings/ducks are all over the place.

There are settings in php.ini that you can do to increase available memory; you may need to talk to your hosting place to increase memory that is available to PHP.

You might also try a generic/base wp-config.php and wp-settings.php file in case there are some modifications that have been done there.

I'd go with adjusting memory settings in the php.ini file, and looking at any memory settings in the wp-config.php file. You might also try a new install of WP with nothing else and place it in a subfolder of your public_html file. Then you can set up that instance with PHP 7.3 with whatever settings that are done via your hosting place (you can have different PHP versions running in different subfolders).

发布评论

评论列表(0)

  1. 暂无评论