Home >Backend Development >PHP Tutorial >laravel - php artisan command reports error, no matter what command is entered

laravel - php artisan command reports error, no matter what command is entered

WBOY
WBOYOriginal
2016-07-06 13:52:011429browse

I followed https://segmentfault.com/a/1190000004598315 step by step, but the php arisan command does not work

laravel - php artisan command reports error, no matter what command is entered

Reply content:

I followed https://segmentfault.com/a/1190000004598315 step by step, but the php arisan command does not work

laravel - php artisan command reports error, no matter what command is entered

There are the following situations:

  1. 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

  2. There is a problem with packages updated using composer update

  3. Updates are interrupted in various situations during composer update, and dependencies are incomplete

  4. Failure to run artisan clear-compield before composer update resulted in old compiled files not being cleared

  5. 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:

How to clean compiled files

  • php artisan clear-compiled
    // Or configure the previous sentence to pre-update-cmd in composer.json to prevent problems later

  • composer update

Use scriptless composer updates and force overwriting of previous compilations

  • composer clearcache

  • composer update --no-scripts

  • php artisan optimize --force

A little more violent

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/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn