【问题标题】:Laravel 5 php artisan not running in Vagrant, missing vendor/services.json?Laravel 5 php artisan 没有在 Vagrant 中运行,缺少 vendor/services.json?
【发布时间】:2015-05-28 04:48:04
【问题描述】:

随机我无法通过 Vagrant SSH 在项目上运行 php artisan。它在 Vegrant SSH(常规终端会话)之外工作。我收到以下错误:

[ErrorException]                                                                                      
  file_put_contents(/home/vagrant/cvahimt/vendor/services.json): failed to open stream: Protocol error 

我已经尝试了所有我能想到的方法 - php artisan clear-compiledcomposer dump-autoload,然后删除 vendor 并再次运行 composer install

我注意到services.json 存在于我的生产环境中,但在本地不存在。我无法创建它,因为vendor 是只读的。

另外,在运行 composer update(带或不带 sudo)时,我收到此错误:

[ErrorException]                                                                                                                  
  file_put_contents(/home/vagrant/cvahimt/vendor/composer/autoload_namespaces.php): failed to open stream: Operation not permitted  

有点问题,我需要运行 php artisan migrate 并且只能通过 Vagrant 运行。

【问题讨论】:

  • 啊!对于发布建议 chmod -R 777 vendor 的答案的用户,请再次发布 - 抱歉,我在 Vagrant 之外尝试了这个,它解决了问题。想给你功劳

标签: laravel composer-php laravel-5 laravel-artisan artisan-migrate


【解决方案1】:
  1. 更改供应商文件夹chmod -R 777 vendor的权限

  2. 运行 php artisan serve 并停止,这将创建 services.json 文件。

【讨论】:

  • 谢谢! :) 知道是什么原因导致这种情况发生吗?昨天工作结束时工作正常
  • 很高兴为您提供帮助!不知道为什么会这样,这里也有同样的问题,但是没时间调试 :) 我希望它会在新的 L5 版本中得到修复。
  • 它工作得很好,但需要在流浪者之外......就像这里laracasts.com/discuss/channels/general-discussion/…
猜你喜欢
  • 1970-01-01
  • 2016-09-11
  • 2016-11-25
  • 2017-06-22
  • 2018-08-12
  • 2017-06-26
  • 1970-01-01
  • 2015-05-20
  • 2020-05-27
相关资源
最近更新 更多