Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    316
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. mohakevin

    mohakevin Well-Known Member

    Joined:
    Jan 19, 2005
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    4
    Trophy Points:
    193
    Location:
    Minneapolis, MN
    Did you restart crond? If yes, it is very likely the entry in crontab is not correct.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    993
    Likes Received:
    2
    Trophy Points:
    168
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice