-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error With WooCommerce #31942
Comments
Hi @cielartisan, Thank you for submitting the issue. However, you didn’t fill out the details of the bug report template that we ask for. Without these details, we can’t fully evaluate this issue. Please provide us with the information requested so we could take a look further. It sounds like you are unable to access the system status report because of the fatal error. It would be helpful if, instead of that, you could provide us any information about your version of PHP and the hosting environment. Describe the bug To Reproduce
Screenshots Expected behavior Isolating the problem (mark completed items with an [x]):
WordPress Environment
```
Copy and paste the system status report from **WooCommerce > System Status** in WordPress admin.
```
|
As a part of this repository’s maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something. After 7 days with no activity this issue will be automatically be closed. |
I'm having similar problem when moving from PHP7.4 to PHP8.0, this was a site moved to a new host with the same hosting (same VM spec) but newer version PHP installation. Now I cannot access the website without disabling woocommerce. I also get this message in my email: `When seeking help with this issue, you may be asked for some of the following information: Error DetailsAn error of type E_ERROR was caused in line 37 of the file /www/wwwroot/web.scmpremier.com/wordpress/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php. Error message: Uncaught Error: Call to undefined function putenv() in /www/wwwroot/web.scmpremier.com/wordpress/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php:37 So I followed the link to enter recovery mode and disable woocommerce plugin and exit recovery mode and my site is working again (without the shop). |
Hello @tonyuh, Could you provide more details? Seems like PHP isn't making |
For the new installation of PHP 8.0 there are some blacklisted functions including |
Hi @cielartisan, Thank you for opening the issue! It requires further feedback from the WooCommerce Core team. We are adding the Please note it may take a few days for them to get to this issue. Thank you for your patience. |
It sounds like this function is being deliberately disabled via the
Containing: <?php
if ( ! function_exists( 'putenv' ) ) {
/**
* No-op placeholder for cases where putenv() is disabled via an .ini file.
*
* @param string $assignment
*/
function putenv( string $assignment ) {}
} This might just help you to workaround this issue, however the very best course of action would be to make a correction to your PHP config (working with your web host if necessary to achieve this). The code that calls |
Thank you so much!! |
Welcome! |
I also encountered this problem, after a Google search problem, I had to remove 'putenv' from the php8 or 8.1 function blacklist, and the site was restored. |
+1 had the same issue and fixed it over the workaround. Hoster seems to have deactivated putenv() |
This is the reason why it worked before PHP 8, putenv() is implemented in WooCommerce as follows: // This is needed to prevent timeouts due to threading. See https://core.trac.wordpress.org/ticket/36534.
@putenv( 'MAGICK_THREAD_LIMIT=1' ); // @codingStandardsIgnoreLine.
https://www.php.net/manual/en/language.operators.errorcontrol.php |
That's a good observation; re-opening as, in that case, probably we should test for the existence of the function/use our own wrapper function). |
I had the same trouble. I resolved it by white list the putenv() function. give a try |
I still have the same trouble, i am using a shared hosting. I am going back and forth with the server admin about need to 1) enable the putenv() function on the server or alternatively, 2) remove this function from the blacklist on php.ini. I thought this has been resolved via #35339 but I am encountering this right now. |
Hi @edison2rinen,
So did we :-)
|
Hi @barryhughes, I figured it out eventually. I had to remove plugins (that i no longer use and were deactivated). I didn't know deactivated plugins can cause this issue. Thanks for replying, I appreciate it! |
I'm a little surprised, too, but glad you found a solution. Fwiw, based on your feedback I did scan the (WooCommmerce Core) codebase for further uses of |
Prerequisites (mark completed items with an [x]):
Issue Description:
My website is broken due to the WooCommerce extension
https://assolartisan.org/
There is only that on the website :
———
Fatal error: Uncaught Error: Call to undefined function putenv() in /var/www/legtux.org/users/cielartisan/www/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php:37 Stack trace: #0 /var/www/legtux.org/users/cielartisan/www/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images.php(49): WC_Regenerate_Images_Request->__construct() #1 /var/www/legtux.org/users/cielartisan/www/wp-includes/class-wp-hook.php(307): WC_Regenerate_Images::init() #2 /var/www/legtux.org/users/cielartisan/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #3 /var/www/legtux.org/users/cielartisan/www/wp-includes/plugin.php(474): WP_Hook->do_action() #4 /var/www/legtux.org/users/cielartisan/www/wp-settings.php(587): do_action() #5 /var/www/legtux.org/users/cielartisan/www/wp-config.php(95): require_once('...') #6 /var/www/legtux.org/users/cielartisan/www/wp-load.php(50): require_once('...') #7 /var/www/legtux.org/users/cielartisan/www/wp-admin/admin.php(34): require_once('...') #8 /var/www/legtux.org/users/cielartisan/www/wp-admin/index.php(10): require_once('...') #9 {main} thrown in /var/www/legtux.org/users/cielartisan/www/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php on line 37
Une erreur critique est survenue sur ce site. Veuillez consulter la boite de réception de l’e-mail d’administration de votre site pour plus d’informations.
En apprendre plus sur le débugage de WordPress. (->https://fr.wordpress.org/support/article/faq-troubleshooting/)
———
WHen I go to with recovery mode on the plingin page, there is this with the WooCommerce extension :
———
Une erreur de type E_ERROR a été causée dans la ligne 37 du fichier /var/www/legtux.org/users/cielartisan/www/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php. Message d’erreur : Uncaught Error: Call to undefined function putenv() in /var/www/legtux.org/users/cielartisan/www/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images-request.php:37 Stack trace: #0 /var/www/legtux.org/users/cielartisan/www/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images.php(49): WC_Regenerate_Images_Request->__construct() #1 /var/www/legtux.org/users/cielartisan/www/wp-includes/class-wp-hook.php(307): WC_Regenerate_Images::init() #2 /var/www/legtux.org/users/cielartisan/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #3 /var/www/legtux.org/users/cielartisan/www/wp-includes/plugin.php(474): WP_Hook->do_action() #4 /var/www/legtux.org/users/cielartisan/www/wp-settings.php(587): do_action() #5 /var/www/legtux.org/users/cielartisan/www/wp-config.php(95): require_once('...') #6 /var/www/legtux.org/users/cielartisan/www/wp-load.php(50): require_once('...') #7 /var/www/legtux.org/users/cielartisan/www/wp-admin/admin.php(34): require_once('...') #8 /var/www/legtux.org/users/cielartisan/www/wp-admin/plugins.php(10): require_once('...') #9 {main} thrown
———
I have inactivated the extension for the moment but it doesn't fix the problem with the extension...
The text was updated successfully, but these errors were encountered: