When trying to create a new laravel project, The following error appears on the CLI:
Could not open input file: artisan
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
I am using the latest version of XAMPP v3.2.1 with PHP 5.5.15 and with mcrypt enabled (made sure of that by issuing the command php -m). And I am running windows 8.1
There is a chance of getting this error when you are running the “php artisan” command outside the Laravel project folder. To resolve this, you need to run the “php artisan” command inside the Laravel project location.
Missing correct permission for artisan There is sometimes a chance of the artisan not being executable, in that case, the artisan command cannot able to access and it will throw an error like this. So you need to confirm that artisan is executable.
Reasons why php artisan serve not workingYou are running php artisan serve command in wrong directory. php artisan serve is laravel command only work with laravel project. Check project directory and run in root directory of your project. The requested host or port is not available.
You need to first create Laravel project and if you already have one you need to go to this project dir using cd
command in terminal for example cd myproject
.
Now you will be able to run any artisan commands, for example running php artisan
will display you list of available commands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With