简体   繁体   English

在“composer install”之后,composer 说 php 版本不同。 我该如何解决?

[英]After 'composer install', composer says the php version is different. How do I solve it?

I've tried several attempts and the results are all unsuccessful.我尝试了几次,结果都没有成功。 composer says my php version is 7.3 but i am already installing php 8.0.2 作曲家说我的 php 版本是 7.3 但我已经在安装 php 8.0.2

I've seen some posts in the same situation as me, but it didn't solve anything at all.我看过一些与我情况相同的帖子,但它根本没有解决任何问题。

this is my test server error code这是我的测试服务器错误代码

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.23. in /home/vagrant/code/interproindigo/vendor/composer/platform_check.php on line 24

But when I run php -v, the php version is 8.0.9 as follows但是当我运行 php -v 时,php 版本为 8.0.9 如下

PHP 8.0.9 (cli) (built: Jul 30 2021 13:03:39) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.9, Copyright (c) Zend Technologies with Zend OPcache v8.0.9, Copyright (c), by Zend Technologies

How can I solve this problem?我怎么解决这个问题?

The problem occurred because the php version of the real server and the test server did not match.出现问题是因为php版本的真实服务器和测试服务器不匹配。 php7.4 -f /usr/local/bin/composer update Entering this code solved the problem. php7.4 -f /usr/local/bin/composer update输入这段代码解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM