Fatal error when web host has disabled the php_uname() function
-
WooCommerce fatal-errors log was showing:
CRITICAL Uncaught Error: Call to undefined function Core\Utils\php_uname() in /var/www/wptbox/wp-content/plugins/woocommerce-square/vendor/apimatic/core/src/Utils/CoreHelper.php:159
The site is hosted on Namecheap EasyWP which has the php_uname() function disabled.
This is the only place in the Square plugin that this function gets called. I was able to fix the error by removing the function call and replacing it with a hard-coded text, so line 159 in CoreHelper.php now says:
return PHP_OS_FAMILY . ‘-5.19.0-1023-aws’;
I am wondering if the php_uname() function call could be removed from the plugin code. Otherwise I will need to manually edit the file every time I update the plugin, and I imagine other users will have the same issue since this function is disabled on many common hosting providers. Thanks!
The topic ‘Fatal error when web host has disabled the php_uname() function’ is closed to new replies.