I got laravel 4, composer installed, PHP 5.4 and mcrypt running but typing the command:

$ php artisan serve 
Could not open input file: artisan

Any attempts to create a new project with command:

$ composer create-project laravel/laravel your-project-name --prefer-dist                         
  The "-p" option does not exist.                                   
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [package] [directory] [version]

I need help to work through my project please.

  • if you have installed laravel 4, then you need to be in laravel4 folder to start php artisan. Regarding composer I think becuae you write your-project-name you should give it a name like myproject1 with out "-" Jun 22, 2015 at 21:33

3 Answers 3


Try this

composer create-project laravel/laravel project-name ~4.2.0 --prefer-dist

~4.2.0 means that you will get the latest version with 4.2.*


I think you had not changed to laravel folder. It contains the artisan file. "Could not open input file" error came because it was not present in current directory.

You can try php /var/www/laravel/artisan serve

Here, php is what you used to access this input file.

Otherwise, change you directory : cd /var/www/laravel

and then try again. Please report again if it didn't work. Thanks.


You have to be in the laravel project directory to use php artisan serve

You can follow this steps. It depends on your server.

$ cd /path/to/laravel/project

Then you can run php artisan serve from here.

Go to browser and enter http://localhost:8000

It should work now!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.