WordPress 7B2主题,返回状态码500

发行版本 ubuntu-20.04
内核版本 5.4.0-152-generic
系统类型 x86_64
面板版本号:1.3.5

7B2主题也算是个WordPress的热门主题,于是今天拿他测试一下,发现有错误。

PHP7.4、8.1的环境下安装此主题后点击登录返回状态码500,并提示此站点遇到了致命错误。其他地方也有问题。宝塔安装此主题无误。

1 个赞

建议开启 DEBUG 模式,查看详细的错误信息。

debug日志
[19-Jun-2023 12:06:27 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function B2\Modules\Common\imagecreatetruecolor() in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Recaptcha.php:13
Stack trace:
#0 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/RestApi.php(1904): B2\Modules\Common\Recaptcha::code_letter('4', '186', '50')
#1 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(1181): B2\Modules\Common\RestApi::getRecaptcha(Object(WP_REST_Request))
#2 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(1028): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/b2/v1/getRecap...', Array, NULL)
#3 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
#4 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/b2/v1/getRecap...')
#5 /www/sites/test.senluowanxiang.cn/index/wp-inclu in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Recaptcha.php on line 13
[19-Jun-2023 12:06:41 UTC] PHP Notice:  Undefined variable: data in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Settings/Orders.php on line 133
[19-Jun-2023 12:06:41 UTC] PHP Notice:  Undefined variable: data in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Settings/Orders.php on line 182
[19-Jun-2023 12:06:48 UTC] PHP Notice:  Undefined variable: data in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Settings/Orders.php on line 133
[19-Jun-2023 12:06:48 UTC] PHP Notice:  Undefined variable: data in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Settings/Orders.php on line 182
[19-Jun-2023 12:07:50 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function B2\Modules\Common\bcmul() in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php:317
Stack trace:
#0 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php(101): B2\Modules\Common\Shop::product_stock('5')
#1 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php(64): B2\Modules\Common\Shop::get_shop_item_data('5', 0, Array, 0)
#2 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/RestApi.php(3074): B2\Modules\Common\Shop::get_shop_items_data(Array, Array, NULL)
#3 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(1181): B2\Modules\Common\RestApi::getShopItemsData(Object(WP_REST_Request))
#4 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(1028): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/b2/v1/getShopI...', Array, NULL)
#5 /www/sites/test.senluowanxiang.cn/inde in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php on line 317
[19-Jun-2023 12:07:53 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function B2\Modules\Common\bcmul() in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php:317
Stack trace:
#0 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php(101): B2\Modules\Common\Shop::product_stock('5')
#1 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php(64): B2\Modules\Common\Shop::get_shop_item_data('5', 0, Array, 0)
#2 /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/RestApi.php(3074): B2\Modules\Common\Shop::get_shop_items_data(Array, Array, NULL)
#3 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(1181): B2\Modules\Common\RestApi::getShopItemsData(Object(WP_REST_Request))
#4 /www/sites/test.senluowanxiang.cn/index/wp-includes/rest-api/class-wp-rest-server.php(1028): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/b2/v1/getShopI...', Array, NULL)
#5 /www/sites/test.senluowanxiang.cn/inde in /www/sites/test.senluowanxiang.cn/index/wp-content/themes/b2/Modules/Common/Shop.php on line 317
2 个赞

作者跟我说是缺少PHP的bcmath扩展

了解。你可以编辑当前站点所用的运行环境,添加该扩展。

我也想啊,扩展里面没有bcmath扩展 :joy:

支持手动输入 :abc:

原来如此,明白了,哈哈,原谅我没看清这一行小字 :joy: