简体   繁体   中英

VPS: switched PHP version but still can't install symfony4

I'm trying to install symfony4 on my VPS, and I have switched to PHP7 but when I run composer install I get this error:

symfony/flex v1.1.1 requires php ^7.0 -> your PHP version (5.6.38) does not satisfy that requirement

Although when I run php -v I get this:

ea-php-cli Copyright 2017 cPanel, Inc.
PHP 7.0.32 (cli) (built: Oct 30 2018 21:21:05) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

I did restarted Apache but still the same problem !

I think you have installed more versions on your system and composer use the older version. You should check some locations.

#/bin/php -v

i think some of your locations have the old version in it. And you have another PATH location in your path variable, where you have the newer version installed. What you can try is to run composer directly with your php version.

#/your/path/to/7/php composer update

then you run that composer phar file with the php version you define.

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