我最近将一个托管在Forge上的项目迁移到了Laravel 8.x。在运行composer install
时,部署脚本会失败,所有与错误PHP版本相关的消息都会显示:
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^7.4 but your PHP version (7.3.26) does not satisfy that requirement.
Problem 2
- Installation request for lcobucci/clock 2.0.0 -> satisfiable by lcobucci/clock[2.0.0].
- lcobucci/clock 2.0.0 requires php ^7.4 || ^8.0 -> your PHP version (7.3.26) does not satisfy that requirement.
...
我确实做过这件事。
根据文档,在Meta > PHP Version中为该站点选择了PHP 7.4。在PHP Management中,默认为7.4,并更新到最新补丁。
我已经重新启动了PHP、Nginx和整个服务器,但都没有起作用。
通过SSH,它正在使用7.3.26:
forge@mistaken-identity:~$ php -v
PHP 7.3.26-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jan 13 2021 08:00:44) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.26, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.26-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
Forge的PHP管理API是坏了,还是只有在我的服务器上出现问题?我想能够基于每个站点设置PHP版本。我该怎么解决这个问题?