CodeIgniter Cron Job through Cpanel

后端 未结 5 993
轻奢々
轻奢々 2020-12-20 08:08

Ok I looked at every other thread and have done exactly what they\'ve done and what it says in the manual and I can NOT figure this out for the life of me. The results of th

相关标签:
5条回答
  • 2020-12-20 08:45

    Had the same issue and after trying whatever I could thing the obvious worked... /usr/local/bin/php /absolute/path/to/index.php cron

    0 讨论(0)
  • 2020-12-20 08:45

    Here is solution first you need to find path from phpinfo document_root file name

    php5 /home/abc/public_html/index.php folder_name controller function

    0 讨论(0)
  • 2020-12-20 08:56

    The default PHP install you are using was probably compiled as CGI-FCGI, not for CLI. It depends on your host and/or server, but you'll need to search for your PHP install for the command line interface, and then use that in your cron job. I had the exact same problem on Hostmonster, and my cron command ended up being:

    /ramdisk/bin/php5-cli ~/public_html/sitefolder/index.php controller method
    

    For me, the PHP I needed was in /ramdisk/bin/php5-cli.

    0 讨论(0)
  • 2020-12-20 09:01

    /usr/local/bin/php /home/jdstable/public_html/dev/index.php cron decrease_pets_stats

    This fixed it.

    0 讨论(0)
  • 2020-12-20 09:09

    For CodeIgniter 2.2.0

    You can try this two method:

    1. php-cli /home/username/public_html/index.php controller method
    2. wget http://www.example.com/controller/method

    or at your case

    1. php-cli /home/username/public_html/index.php Cron decrease_pets_stats
    2. wget http://www.example.com/Cron/decrease_pets_stats

    It works fine with me.. Cheers!

    0 讨论(0)
提交回复
热议问题