Wordpress and PHP 8.0

TIKTIK

Member
Feb 1, 2020
57
17
8
Hello,

I`m using WordPress last version with PHP 7.4.
I`m getting a fatal error every time I`m trying to upgrade to PHP 8.0.

Fatal error: Uncaught Error: Call to undefined function putenv() in /www/wwwroot/mydomain/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php:37 Stack trace: #0 /www/wwwroot/mydomain/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images.php(49): WC_Regenerate_Images_Request->__construct() #1 /www/wwwroot/mydomain/wp-includes/class-wp-hook.php(307): WC_Regenerate_Images::init() #2 /www/wwwroot/mydomain/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #3 /www/wwwroot/mydomain/wp-includes/plugin.php(476): WP_Hook->do_action() #4 /www/wwwroot/mydomain/wp-settings.php(598): do_action() #5 /www/wwwroot/mydomain/wp-config.php(95): require_once('...') #6 /www/wwwroot/mydomain/wp-load.php(50): require_once('...') #7 /www/wwwroot/mydomain/wp-blog-header.php(13): require_once('...') #8 /www/wwwroot/mydomain/index.php(17): require('...') #9 {main} thrown in /www/wwwroot/mydomain/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php on line 37
There has been a critical error on your website.

Any one know how to solve it?
 
  • Like
Reactions: Groot

Groot

Well-known member
Jun 17, 2020
412
415
63
Stay with 7.4 or try to disable error display on PHP 8.
 

Lakuma

Active member
Babiato Lover
May 4, 2022
35
153
33
Stay with 7.4 or try to disable error display on PHP 8.
You can. However, PHP 7.4 will only receive security updates until 28 Nov 2022. Then you run the risk of being vulnerable to security risks.

It would be better to resolve the root cause.

I would put your site in maintenance mode while troubleshooting with the following:

Try disabling all your plugins and enabling each one to see if any of them are causing the fatal issue.

It might also be your theme that is not compatible with 8.0.

You might also want to look at the backend log files to see additional output other than what you're seeing on the front end.
 
  • Like
Reactions: Groot

Groot

Well-known member
Jun 17, 2020
412
415
63
There many the same problems on net, you can find out and try yourself, but I see some cases:
You not use latest stable PHP 8 version, check server info in Site Health to see this. Update to stable which Woo support (8.1.3, avoid 8.0).
Or
The same case & solution:

It not like problems from theme or plugin when we look above errors.
 
  • Like
Reactions: Lakuma

TIKTIK

Member
Feb 1, 2020
57
17
8
PROBLEM SOLVED.
I removed putenv function from the blacklist, and I still got the error.
But, it stopped after I restart the PHP service on my server.
THANK YOU ALL
 
  • Like
Reactions: Groot

Groot

Well-known member
Jun 17, 2020
412
415
63
PROBLEM SOLVED.
I removed putenv function from the blacklist, and I still got the error.
But, it stopped after I restart the PHP service on my server.
THANK YOU ALL
Right, you should restart anytime server rules change.
 

Latest posts

Forum statistics

Threads
69,482
Messages
909,936
Members
239,751
Latest member
afshin.dehghani1

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu