doumen9709 2016-10-04 06:27
浏览 37
已采纳

Laravel Scheduling - 是否需要域名

Is a domain name required to run chronjobs in a Laravel application on a server? Or can I get by without it? There will be no human interaction with this application, only day-to-day automated tasks.

My understanding is that for a regular Laravel application, you are required to configure the apache .conf file to link the server files & var/www/<laravel_application> with the world.

Is there a conventional way to achieve this without a domain name? Or should I set up a new domain name?

Note: Not sure if this is important, but it's a VPS server

Update: I forgot to mention that this application will interact with APIs elsewhere on the web.

  • 写回答

2条回答 默认 最新

  • dtp19819 2016-10-04 06:33
    关注

    Sure, it's possible. You only have to follow instructions on Task Scheduling docs page. Laravel scheduler/commands do not require any acces via web.

    You just need to add this line (taken from docs) to crontab on your server

    * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?