Cron Job in symfony2

后端 未结 4 2037
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 06:52

I create a console command in my project. I want it to be executed everyday at 7 p.m. How could i do it in symfony2? A basic php cron job way or symfony2 have something more con

4条回答
  •  悲&欢浪女
    2021-02-01 07:38

    Pay attention to the user you use to execute the command. If you run it as root, root could own Symfony cache then break your site HTTP side (because nginx will run as www-data user for example).

    With Docker, I am using phusion base image "setuser" method to force www-data user.

提交回复
热议问题