没有不值得去解决的问题,也没有不值得去学习的技术!

Composer Detected Platform Issues: Your Dependencies Require PHP >= 7.3.0

Composer detected issues in your platform:Your Composer dependencies require a PHP version ">= 7.3.0". Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".

1. Composer detected issues in your platform:Your Composer dependencies require a PHP version “>= 7.3.0”. Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.3.0”. See Figure 1.

Composer detected issues in your platform:Your Composer dependencies require a PHP version ">= 7.3.0". Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".
Figure 1
Plaintext

[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. The root cause is that the program needs to be deployed on Huawei Cloud’s ARM (Kunpeng) architecture cloud server. Therefore, the base image was replaced with an image that supports ARM, which in turn changed the PHP version to PHP 7.2.20. AArch64 is the 64-bit state introduced in the Armv8-A architecture. See Figure 2.

The root cause is that the program needs to be deployed on Huawei Cloud's ARM (Kunpeng) architecture cloud server. Therefore, the base image was replaced with an image that supports ARM, which in turn changed the PHP version to PHP 7.2.20. AArch64 is the 64-bit state introduced in the Armv8-A architecture.
Figure 2
Plaintext

[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. View composer.json. “php”: “>=7.3.0”,. See Figure 3.

View composer.json. "php": ">=7.3.0",.
Figure 3

4. Since /vendor has already been committed to the Git repository. Edit composer.json: “php”: “>=7.2.0”,. See Figure 4.

Since /vendor has already been committed to the Git repository. Edit composer.json: "php": ">=7.2.0",.
Figure 4
Plaintext

    "require": {
        "php": ">=7.2.0",
    },

5. Switch the PHP version of the local Windows environment to 7.2.14 to keep it consistent with the major PHP version of the production environment image: 7.2.20. See Figure 5.

Switch the PHP version of the local Windows environment to 7.2.14 to keep it consistent with the major PHP version of the production environment image: 7.2.20.
Figure 5
Plaintext

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. Delete the directory: /vendor, delete: composer.lock, and re-run: composer install. See Figure 6.

Delete the directory: /vendor, delete: composer.lock, and re-run: composer install.
Figure 6

7. Run the health check program, a PHP script, which responds with 200 and no longer reports errors. The problem is resolved. See Figure 7.

Run the health check program, a PHP script, which responds with 200 and no longer reports errors. The problem is resolved.
Figure 7
Plaintext

[root@payment-7d74df5689-cfckp /]# curl http://payment.cmc/check-status
200[root@payment-7d74df5689-cfckp /]# 

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系