1、Composer detected issues in your platform:Your Composer dependencies require a PHP version “>= 7.3.0”.。Composer 在您的平台中检测到问题:您的 Composer 依赖项需要 PHP 版本 “>= 7.3.0″。如图1
[root@payment-7865946b4-v88ld /]# curl http://payment.cmc/check-status Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".
2、根源在于,需要将程序部署在华为云的ARM (鲲鹏)架构的云服务器上,因此,基础镜像换为一个支持 ARM 的镜像,进而 PHP 版本变化为:PHP 7.2.20。AArch64是Armv8-A架构中引入的64位状态。如图2
[root@payment-7865946b4-v88ld /]# cat /etc/redhat-release CentOS Linux release 7.8.2003 (AltArch) [root@payment-7865946b4-v88ld /]# cat /proc/version Linux version 4.18.0-80.7.2.el7.aarch64 (mockbuild@aarch64-01.bsys.centos.org) (gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)) #1 SMP Thu Sep 12 16:13:20 UTC 2019 [root@payment-7865946b4-v88ld /]# arch aarch64 [root@payment-7865946b4-v88ld /]# php -v PHP 7.2.20 (cli) (built: Aug 12 2020 19:02:44) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.20, Copyright (c) 1999-2018, by Zend Technologies [root@payment-7865946b4-v88ld /]#
3、查看 composer.json。”php”: “>=7.3.0”,。如图3
4、由于 /vendor 已经放入 Git 仓库中。编辑 composer.json:”php”: “>=7.2.0”,。如图4
"require": { "php": ">=7.2.0", },
5、将本地 Windows 环境的 PHP 版本切换至:7.2.14,与生产环境的镜像的 PHP 大版本:7.2.20 保持一致。如图5
PS C:/WINDOWS/system32> php -v PHP 7.2.14 (cli) (built: Jan 9 2019 22:23:26) ( ZTS MSVC15 (Visual C++ 2017) x64 ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
6、删除目录:/vendor ,删除:composer.lock,重新执行:composer install。如图6
7、运行健康检查程序,一个 PHP 脚本,响应 200,未再报错。问题解决。如图7
[root@payment-7d74df5689-cfckp /]# curl http://payment.cmc/check-status 200[root@payment-7d74df5689-cfckp /]#
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/181747.html