升级到支持PHP 8.1的版本时,在部署过程中出错

本文提供了在升级到支持PHP 8.1的版本时部署过程中发生的错误的解决方案。

受影响的产品和版本

  • 云基础架构上的Adobe Commerce 2.4.4及更高版本

  • 扩展或技术(Fastly、New Relic等)版本PHP 8.1

问题

在升级到支持PHP 8.1的版本时,在部署过程中出现以下错误。

{{E: Error parsing configuration files:

applications: Uncaught exception: The "json" extension is not supported for php:8.1
at <script>:109:12
throw("The \"" + unsupported_extensions[0] + "\" extension is not supported for " + service.type);
^
E: Error: Invalid configuration files, aborting build}}

原因

PHP 8.1已包含JSON支持,并且不需要单独安装扩展。

解决方案

.magento.app.yaml中的​ 运行时 > 扩展 ​部分删除JSON并重新部署。

相关阅读

在我们的开发人员文档中PHP应用程序

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a