Laravel After modifying the configuration, be sure to clean up the cache "PHP artisan config:clear"!

Source: Internet
Author: User

Use Laravel to step on a big hole ...

You need to use the Laravel queue function,

Setting the ". Env" configuration file

Queue_driver=database

Follow the documentation, build the jobs data table, generate the task class, and push the task (dispatch) into the queue in the controller.

The problem is that the jobs table does not generate queue task data ...

Toss a day, check the document, upgrade PHP, even read some of the source code, is not find the reason!

Finally, look at the source output of the process found that the configuration has not changed, how to change the Queue_driver are sync ...

The original laravel will be the configuration file cache ....

=========================================================

Configure caching

To accelerate your app, you can use the Artisan command to config:cache cache all configuration file configurations into a single file, which merges all configuration options into a single file so that it can be loaded quickly by the framework.
Once the application is online, it runs once php artisan config:cache , but it is not necessary to run the command frequently when it is developed locally, because configuration values often need to be changed.

=========================================================

PHP Artisan Config:clear can clear the configuration file ...

The configuration has changed and you can use the queue.

It took a long time to find that Laravel can not set the reason for the queue, but repeatedly looked at many times the queue document, looked up a lot of information, the function has a more in-depth understanding!

Configure file Caching
PHP Artisan Config:cache

[HTML]View PlainCopy
      1. PHP Artisan Cache:clear
      2. PHP Artisan Config:clear

Laravel Make sure to clean up the cache "PHP artisan config:clear" After modifying the configuration!

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.