Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Laravel Homestead - 'Could not open input file - artisan'

Hi guys,

LARAVEL QUESTION

I keep on receiving the error 'Could not open input file - artisan' whenever I try to run a PHP artisan command, for example when attempting to create a migration for the todo lists table in Hampton's tutorial 'Migrations & Schema Builder'. I cannot help but notice that Hampton's Bash prompt is set to: 'vagrant@homestead ~/Sites/laravel-basics$' whereas my prompt is simply set to 'vagrant@homestead' - could this be the reason for my unfortunate faux-pas? I have tried to 'cd' into my current directory after running 'Vagrant SSH', but I receive a separate error 'Projects - No such file or directory'. Perhaps I am doing this incorrectly?

Please help!!

Robert London, UK

Thiago van Dieten
Thiago van Dieten
16,639 Points

Have you tried typing

ls 
```in your SSH session to see what directories are in your home folder?

2 Answers

Unfortunately I have not done the Laravel course yet so I can only guess.

  1. run dir to see what directories are available.
  2. if the directory does not exist, rewatch the video to see if you skipped a step. I have done that before and it is confusing until you follow all the steps.
  3. If the directory does not exist and you followed all the steps in the video, create the directory manually. You will have to google how to do it if you do not know.
  4. If the directory exists, then you probably do not have the permissions to make changes. Again, google how to change the permissions of the folder or take the command line course here at Treehouse.

Let me know if none of these suggestions work.

vagrant@homestead type ls if will show you your files and folder in that directory, if your default is Code you can cd Code then ls again to see if you have already installed laravel if not you can use composer to install it first. if laravel is install you can start using php artisan command. ALSO you cannot use php artisan if you not inside a laravel folder. that is why it is saying 'Could not open input file - artisan'