CodeIgniter Cron Job on Shared Hosting?

前端 未结 4 724
暖寄归人
暖寄归人 2021-02-06 16:56

I am trying to learn how to do my first cron job using CodeIgniter. In the past, it seemed the only way to do this with CI was to use the wget command instead of

4条回答
  •  借酒劲吻你
    2021-02-06 17:18

    I've set up 100s of CI cronjob on shared hosting like this: create a short php script which calls the CI controller as if it was a webbrowser.

    So, script.php contains this:

          script #! /usr/local/bin/php -f /home/example/public_html/script.php 
    
      
    

    Then set your cronjob in cPanel to call script.php When it runs Script.php will call the Codeigniter Cronjob controller. There you have the entire CI framework at your disposal.

提交回复
热议问题