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条)

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站