简体   繁体   中英

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

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 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. php7.4 -f /usr/local/bin/composer update Entering this code solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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