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.

why a php script won't run when place in cron.. fine when i run it manually..

Discussion in 'General Discussion' started by gundamz, Mar 20, 2007.

  1. gundamz

    gundamz Well-Known Member

    Joined:
    Mar 27, 2002
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    16
    Hi all,

    I couldn't find any error to trace down the reason why my php script did not run though cron indicate that it was started. When i run the script manually, it works.

    I couldn't remember what caused this.
     
  2. mohakevin

    mohakevin Well-Known Member

    Joined:
    Jan 19, 2005
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    If you try to run the script in the command line, in example:

    does it say any errors ?

    Besides, check if there are several php installed.

    You can try with:

    whereis php


    or with:

    locate php

    Regards
     
  3. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Did you restart crond? If yes, it is very likely the entry in crontab is not correct.
     
  4. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    try php -q -f /home/{account}/public_html/{path_to_cron_script.php} OR lynx --dump http://www.yourdomain.com/{path_to_cron_script.php} in your crontab entry :)
     
Loading...

Share This Page