• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Wordpress and PHP 8.0

TIKTIK

Member
Feb 1, 2020
84
26
18
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
Stay with 7.4 or try to disable error display on PHP 8.
 
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
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
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
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.
 

Forum statistics

Threads
79,298
Messages
1,138,560
Members
247,798
Latest member
tahasalim
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock