使用Symfony命令行时如何覆盖作曲家问题检测
我的主机更新了作曲家版本(2.2),而无需更新PHP版本(7.0.33)。
当我运行Composer [命令]
时,我会得到此错误:
作曲家2.3.0丢弃了对PHP< 7.2.5的支持,并且您正在运行7.0.33-0+DEB9U12,请升级PHP或通过“ Composer self-Update -2.2”使用Composer 2.2 LTS。流产。
我没有降级作曲家的选项(Composer self-update -2.2
给我相同的内容),此PHP版本已锁定。
因此,我决定使用/opt/plesek/php/7.4/bin/php/usr/lib/lib/plesek-9.0/composer.phar [command]
而不是工作。我认为php/usr/lib/plesk-9.0/composer.phar
也可以使用。
我正在使用Symfony 4,现在我需要部署我的应用程序。但是,当我尝试php bin/console学说:架构:update -dump-sql
作曲家检测问题,因为我的依赖性需要比var中定义的更高的PHP版本
PHP致命错误:作曲家在您的平台中检测到的问题:您的作曲家依赖性需要PHP版本“> = 7.2.5”。您正在运行7.0.33-0+DEB9U12。 in/var/www/vhosts/client-name/httpdocs/vendor/composer/platform_check.php on Line 24
第一个问题上:为什么当我尝试使用教学cli更新我的数据库时,为什么要调用作曲家?
我尝试的
我运行Composer Config Platform.php 7.0.33
我的一些依赖性现在太新了,所以我试图将它们降级到最新的主要版本。
我更改了php的版本和“ require”部分中的库,然后运行/opt/plesek/php/7.4/bin/php/php/lib/lib/plesk-sk--9.0/composer.phar-phar-phar-with-putse -with-依赖项
(因为只有作曲家
导致我问题) 它不适用于需要PHP 7.1的学说,我不想回到学说1(2010年发行了学说2.0)
第二个问题:您有任何建议吗?我看不到立即解决方案
My host updated composer version ( 2.2 ) without updating php version ( 7.0.33 ).
When I run composer [command]
, I get this error:
Composer 2.3.0 dropped support for PHP <7.2.5 and you are running 7.0.33-0+deb9u12, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
I don't have the option to downgrade composer (composer self-update --2.2
give me the same ) and this php version is locked.
So I decided to use /opt/plesk/php/7.4/bin/php /usr/lib/plesk-9.0/composer.phar [command]
instead and it works. I think php /usr/lib/plesk-9.0/composer.phar
will work too.
I'm using Symfony 4 and now I need to deploy my application. But when I try php bin/console doctrine:schema:update --dump-sql
composer detect issues because my dependencies require a higher php version than defined in var
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5". You are running 7.0.33-0+deb9u12. in /var/www/vhosts/client-name/httpdocs/vendor/composer/platform_check.php on line 24
First question: Why composer is called when I try to update my database using doctrine CLI?
What I tried
I run composer config platform.php 7.0.33
Some of my dependencies are now too new, so I'm trying to downgrade them to the latest major version.
I changed the version of PHP and in libraries in the "require" section and I run /opt/plesk/php/7.4/bin/php /usr/lib/plesk-9.0/composer.phar update --with-dependencies
( because just composer
cause me problems )
It doesn't work for doctrine which need PHP 7.1 and I don't want to go back to doctrine 1 ( doctrine 2.0 was released in 2010 )
Second question: Do you have any suggestion? I don't see an immediate solution
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,我不得不通过运行:
$
brew unlink [> [> [> [>)电子邮件&nbsp;受保护]
$
brew link [email&nbsp; nbsp;受保护]
希望可以帮助某人。
I had the same issue and I had to upgrade PHP by running:
$
brew unlink [email protected]
$
brew link [email protected]
Hope that can help someone.
如果您的问题与我相同,则可能需要直接使用PHP二进制文件来调用Symfony命令:
/opt/plesek/php/7.4/bin/php/php bin/console d:s:s:u -dump-sql < /代码>
If you have the same problem than me, you may need to call symfony command using PHP binaries directly:
/opt/plesk/php/7.4/bin/php bin/console d:s:u --dump-sql