Laravel is a type of free, open-source PHP web framework that uses composer as a tool for integrating dependencies and libraries in it.
It has a command-line interface called Artisan.
The command used to start a Laravel service is given below,
php artisan
Recently some of our clients got errors like the “Could not open input file: artisan” error when starting the Laravel service using the above command.
Cause and solution for “Could not open input file: artisan” error in Laravel
Causes :
There are mainly two causes that can be behind this error.
1. Incorrect console location
There is a chance of getting this error when you are running the “php artisan” command outside the Laravel project folder.
Solution :
You should run the “php artisan” command inside the Laravel project location.
cd my_laravel_project/
php artisan
You can replace the “my_laravel_project/” with your Laravel project location.
2. 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.
Solution :
chmod +x artisan
If you are still stuck in solving this Laravel issue, our technical support team will resolve it for you.