Laravel-Composer更新和托管在Azure问题上

时间:2019-01-02 14:08:37

标签: laravel azure laravel-5 composer-php

我当时正在计算机上本地开发项目,并使用Gi​​t将更新推送到Azure,现在面临的问题是我在本地运行了Composer update命令,现在我将当前更新推送到了天蓝色得到这个错误

 Problem 1
 remote:     - Installation request for doctrine/inflector v1.3.0 -> satisfiable by 
 doctrine/inflector[v1.3.0].
 remote:     - doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (7.0.32) 
 does not satisfy that requirement.
 remote:   Problem 2
 remote:     - Installation request for symfony/contracts v1.0.2 -> satisfiable by 
 symfony/contracts[v1.0.2].
 remote:     - symfony/contracts v1.0.2 requires php ^7.1.3 -> your PHP version 
 (7.0.32) does not satisfy that requirement.
 remote:   Problem 3
 remote:     - Installation request for symfony/css-selector v4.2.1 -> satisfiable by 
 symfony/css-selector[v4.2.1].
 remote:     - symfony/css-selector v4.2.1 requires php ^7.1.3 -> your PHP version 
 (7.0.32) does not satisfy that requirement.
 remote:   Problem 4
 remote:     - Installation request for symfony/event-dispatcher v4.2.1 -> satisfiable 
 by symfony/event-dispatcher[v4.2.1].
 remote:     - symfony/event-dispatcher v4.2.1 requires php ^7.1.3 -> your PHP version 
 (7.0.32) does not satisfy that requirement.
 remote:   Problem 5
 remote:     - Installation request for symfony/translation v4.2.1 -> satisfiable by 
 symfony/translation[v4.2.1].
 remote:     - symfony/translation v4.2.1 requires php ^7.1.3 -> your PHP version 
 (7.0.32) does not satisfy that requirement.
 remote:   Problem 6
 remote:     - symfony/translation v4.2.1 requires php ^7.1.3 -> your PHP version 
 (7.0.32) does not satisfy that requirement.
 remote:     - nesbot/carbon 1.36.2 requires symfony/translation ~2.6 || ~3.0 || ~4.0 - 
 > satisfiable by symfony/translation[v4.2.1].
 remote:     - Installation request for nesbot/carbon 1.36.2 -> satisfiable by 
 nesbot/carbon[1.36.2].
 remote:
 remote:
 remote: Error - Changes committed to remote repository but deployment to website 
 failed.
 To https://#####.azurewebsites.net/#####.git
  + da3acfe...3dfc921 master -> master (forced update)

2 个答案:

答案 0 :(得分:0)

您必须要求PHP 7.1.3的PHP版本(7.0.32)不满足该要求的某些软件包。

除此之外,自2018年12月3日起,PHP 7.0已unsupported

答案 1 :(得分:0)

您刚刚更新了PHP 7.0不再支持的所有composer软件包,您将需要将PHP版本至少升级到7.1.3,但是我建议将其更新到最新的稳定版本。 7.3.0

关于如何升级您的PHP版本的解决方案很多,但是here is one I found,或阅读下面的内容。

运行以确保您具有PHP存储库。

$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update

停止服务器并安装PHP 7.1

$ service apache2 stop 
**// OR depending on what you use.**
$ service nginx stop

$ sudo apt-get install php7.1 php7.1-common

Laravel和Composer的详细信息

$ sudo apt-get install php7.1-curl php7.1-xml php7.1-zip php7.1-gd php7.1-mysql php7.1-mbstring

检查您的版本

$ php -v

它应该显示为7.1

删除7.0

$ sudo apt-get purge php7.0 php7.0-common

显示/重新启动服务器

$ sudo shutdown -r now

如果您使用的是apache,请告诉apache使用7.1

$ a2enmod php7.1
$ service apache2 restart

这应该足以让您运行,但是理想情况下,您应该更新到最新的稳定器。只要确保您保持所有更新都可以。