laravel-php Artisan Command Error, no matter what command you enter

Source: Internet
Author: User

I followed the https://segmentfault.com/a/1190000004598315 step-by-step, but the PHP arisan command could not be used

Reply content:

I followed the https://segmentfault.com/a/1190000004598315 step-by-step, but the PHP arisan command could not be used

There are several situations:

    1. There is a problem with the code that must be loaded before the framework runs, such as your service provider, and interrupts when executing optimize

    2. There is a problem with the package updated with composer update

    3. Composer update interrupt, dependency incomplete

    4. Composer Update did not run before artisan Clear-compield caused the old compilation file not to be cleared

    5. Optimize will write compiled.php and Service.json files in the bootstrap/cache/folder, check the folder permissions

But you are using Windows, 5 can be ignored, 4 is the most likely

Several sets of solutions are recommended:

How to clean up a compiled file

    • PHP Artisan clear-compiled
      Or configure the previous sentence to Pre-update-cmd in Composer.json in case there is a problem later

    • Composer Update

Use script-free composer updates and force overwriting of previous compiled content

    • Composer ClearCache

    • Composer Update--no-scripts

    • PHP Artisan optimize--force

A little violence.

If you still have a problem, simply delete the vendor directory and Composer.lock, use composer install--no-scripts reinstall, remember to run PHP artisan optimize--force

Execution: Composer install try again

PHP Artisan route:list
Are you sure you set up a route?

Introductory recommendation to learn the basics
http://laravel-china.org/

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.