Home >Backend Development >PHP Tutorial >laravel - php artisan command reports error, no matter what command is entered
I followed https://segmentfault.com/a/1190000004598315 step by step, but the php arisan command does not work
I followed https://segmentfault.com/a/1190000004598315 step by step, but the php arisan command does not work
There are the following situations:
There is a problem with the code that must be loaded before your service provider and other frameworks run, and it is interrupted when executing optimize
There is a problem with packages updated using composer update
Updates are interrupted in various situations during composer update, and dependencies are incomplete
Failure to run artisan clear-compield before composer update resulted in old compiled files not being cleared
optimize will write map files such as compiled.php and service.json in the bootstrap/cache/ folder, check the folder permissions
But seeing as you are using Windows, 5 can be ignored, 4 is the most likely
Recommend several sets of solutions:
php artisan clear-compiled
// Or configure the previous sentence to pre-update-cmd in composer.json to prevent problems later
composer update
composer clearcache
composer update --no-scripts
php artisan optimize --force
If there are still problems, just delete the vendor directory and composer.lock, use composer install --no-scripts to reinstall, remember to run php artisan optimize --force
Execute: composer install and try again
php artisan route:list
Are you sure you have set the route?
If you want to learn the basics, it is recommended to get started
http://laravel-china.org/