The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cant Run CronJob

Discussion in 'General Discussion' started by SD_Syndicate, Jul 12, 2006.

  1. SD_Syndicate

    SD_Syndicate Registered

    Joined:
    Jul 10, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Newcastle, UK
    Hi all,

    First time on forum so bare with me :)

    Ive used cPanel for a few years now and havent had any troubles until a few months ago.

    I had my site down for awhile but Ive recently put it back up, althou when I create a CronJob I get an email saying...

    /bin/sh: /home/user/public_html/includes/dailycheck.php: No such file or directory

    I remember my friend saying that I cant use the 'GET' command anymore, so does anyone know what the command is just to run a basic '.php' page? I know how to set up the times to run it, I just cant seem to get the page to execute.

    Thanks in advance.
     
  2. ras`

    ras` Member

    Joined:
    Apr 25, 2006
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    try /usr/bin/php dailycheck.php
     
    #2 ras`, Jul 12, 2006
    Last edited: Jul 12, 2006
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    The file definitely exists?

    Care you clarify what you mean by "I cant use the 'GET' command anymore"?

    On top of that, a little bit of an explanation of running PHP scripts as cron jobs is required.

    Executing a PHP script through a cron job is the same as executing it via the command line. Therefore if you have shell access, try the following:

    Code:
    /usr/bin/php /full/path/to/script.php
    /full/path/to/script.php
    The former should work, whereas the latter will only work if you PHP script has the correct shebang line present (#!/usr/bin/php).

    If you only ever intend to run the PHP script via the command line (or via a cron job), you'd probably be better off adding the shebang line (it should be the very first line, before the opening '<?php') and moving the script to a non-browsable directory.
     
  4. SD_Syndicate

    SD_Syndicate Registered

    Joined:
    Jul 10, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Newcastle, UK
    Thanks for the reply fellas.

    The 'GET' command is what I used to use, cant remember it exactly but it was something like 'GET pagename.php </dev></null>'

    Trying both your methods I now recieve an email saying

    Status: 404
    Content-type: text/html
    X-Powered-By: PHP/4.3.10

    No input file specified.


    is the link definatly '/home/user/public_html/includes/_dailycheck.php'? - and 'user' being my "Account Name"?
     
    #4 SD_Syndicate, Jul 12, 2006
    Last edited: Jul 12, 2006
  5. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    That's an error from the PHP script. That is, the script is being executed by the cron job but is encountering an internal logic error. You'd have to troubleshoot the script itself.

    The path is /home/user/path/to/script.php - the script does not necessarily have to reside in your public_html directory.
     
Loading...

Share This Page