Godaddy cron job setup for running php script

后端 未结 10 2202
生来不讨喜
生来不讨喜 2021-02-03 13:30

can you help me setup cron job on godaddy webhosting? I have php file that i need to run, it is located in cron subdirectory (so address is http://test.com/cron/file.php). What

相关标签:
10条回答
  • 2021-02-03 13:46

    If you want to run a cron job in Godaddy. You can find following command, it will surely help you.

    php -f /home/[user name]/[path to the file] 
    
    0 讨论(0)
  • 2021-02-03 13:51

    If you are using Godaddy this should solve your issue.

     *  *   *   *   *   /usr/local/bin/php /home/path/to/your/file.php > /dev/null
    
    0 讨论(0)
  • 2021-02-03 13:52
    php_path -q file_name_with_absolute_path
    
    /usr/bin/php -q /home/[user name]/public_html/test.php
    

    1: How to know your php_path?

    echo exec('whereis php');
    

    2: How to know absolute path of your file?

    echo dirname(__FILE__);
    
    0 讨论(0)
  • 2021-02-03 13:53

    Use, for example CURL or wget or lynx.

    lynx -s http://link.to/script.php
    
    0 讨论(0)
提交回复
热议问题