[英]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: 我正在尝试在VPS上安装symfony4,并且我已切换到PHP7,但是在运行
composer install
此错误:
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: 虽然当我运行
php -v
我得到了:
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 ! 我确实重新启动了Apache,但仍然是同样的问题!
I think you have installed more versions on your system and composer
use the older version. 我认为您已经在系统上安装了更多版本,并且
composer
使用的是旧版本。 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.
而且,您的路径变量中还有另一个PATH位置,在该位置中安装了较新的版本。 What you can try is to run composer directly with your php version.
您可以尝试的是直接在您的php版本中运行composer。
#/your/path/to/7/php composer update
then you run that composer phar file with the php version you define. 然后使用您定义的php版本运行该composer phar文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.