2

Randomly I cannot run php artisan on a project via Vagrant SSH. It works outside of Vegrant SSH (regular terminal session). I am receiving the following error:

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

I have tried everything I can think of - php artisan clear-compiled, composer dump-autoload, and removing vendor and running composer install again.

I noticed that services.json exists in my production environment but is absent locally. I cannot create it because vendor is read-only.

Also, when running composer update (with or without sudo) I receive this error:

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

Kind of a problem, I need to run php artisan migrate and that only works via Vagrant.

NightMICU
  • 9,000
  • 30
  • 89
  • 121
  • Argh! To the user that posted the answer suggesting `chmod -R 777 vendor` please post it again - sorry, I tried this OUTSIDE of Vagrant and it fixed the problem. Want to give you credit – NightMICU Mar 24 '15 at 18:25

1 Answers1

5
  1. change permissions on vendor folder chmod -R 777 vendor

  2. run a php artisan serve and stop, this will create the services.json file.

Limon Monte
  • 52,539
  • 45
  • 182
  • 213
  • Thanks! :) Any idea what causes this to happen? Was working fine at the end of work yesterday – NightMICU Mar 24 '15 at 18:33
  • 1
    Glad to help! Don't know why it happens, have the same issue here, but have no time to debug :) I hope it will be fixed in new L5 versions. – Limon Monte Mar 24 '15 at 18:34
  • It works very well, but needs to be outside of the vagrant.... as here https://laracasts.com/discuss/channels/general-discussion/cannot-run-artisan-in-vagrant-vendorservicesjson-missing – insign Nov 02 '15 at 14:18