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.

Cron Job Help Please...

Discussion in 'General Discussion' started by mikka12, Jul 12, 2010.

  1. mikka12

    mikka12 Registered

    Joined:
    Jul 12, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I recently got a php script that does some tasks for me, but am having difficulty setting it up as a cron job.

    This is the email cron daemon sends to me when it attempts to execute every 5 minutes.

    Status: 404 Not Found
    X-Powered-By: PHP/5.2.13
    Content-type: text/html

    No input file specified.


    I have the php script installed like this.

    http://www.mydomain.com/specificfolder/actualscript.php

    now in the cron option i did this.

    set it up for 5 minutes

    and inputted this in the line field.

    php http://www.mydomain.com/specificfolder/actualscript.php
    ^ i did the space.

    Okay, I would really appreciate some help. Thanks a lot.
    I am sure the problem resides in the way I write the destination php file, but don't know how to properly put it in.

    Thank you
     
  2. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    Try to change the http://www.mydomain.com/specificfolder/actualscript.php to the actual path to the file (/home/user/public_html/specificfolder/actualscript.php) rather than what you have. Also, try changing php to php -q, so you end up with:

    Code:
    php -q /home/user/public_html/specificfolder/actualscript.php
     
  3. mikka12

    mikka12 Registered

    Joined:
    Jul 12, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks...

    Okay, I did that, but the email i get now is

    No input file specified.

    thanks for the help by the way :)
     
  4. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    Try /usr/local/bin/php instead of just php in the command instead. Also, are you sure you have the right path to the file (no errors in the username or folder name)?
     
  5. mikka12

    mikka12 Registered

    Joined:
    Jul 12, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    sorry, that last suggestion you made would go before the file destination?

    usr/fldr/cg/bin/php and then the location of the php script?
     
  6. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    It would become:

    Code:
    /usr/local/bin/php -q /home/user/public_html/specificfolder/actualscript.php
    By not giving us the real path you are using (since this isn't the actual domain now but just a path with a username and who could guess your domain from a username, it seems you could provide the real information at this point), it makes it difficult to know if you are doing it right. If that still doesn't work, either you would want to open a ticket with your host or provide the real command you are using at that point.
     
Loading...

Share This Page