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.

Crons not working

Discussion in 'General Discussion' started by tbabgaming, Nov 27, 2007.

  1. tbabgaming

    tbabgaming Registered

    Joined:
    Aug 11, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I just set up a centos 4.5 server with cpanel, the crond process is running ive restarted it to insure it wasnt a dead process and the crons save in the cpanel list but the do not run. most of the crons on our server are using CURL which is enabled.

    Two methods for the cron have been tested

    method 1: curl http://domain/1.php

    /bin/sh: curl: command not found


    method 2: /home/username/public_html/1.php

    /bin/sh: /home/username/public_html/1.php: Permission denied

    Also note that i have tried the suggestions in the threads here to update the permissions for crontab

    any advice?
     
    #1 tbabgaming, Nov 27, 2007
    Last edited: Nov 27, 2007
  2. mitul

    mitul Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    Can you post the crontab entry as it appears in system.
     
  3. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    on shell as root type:

    which php
    -----------------

    this will give you the path to php : say : /usr/local/bin/php

    Set the cron as :

    /usr/local/bin/php /home/username/public_html/1.php

    and it should work. Note that in some cases; you need to be at a particular directory for the cron to execute; in such cases, set the cron as

    cd DIRECTORY ; /usr/local/bin/php /PATH_WRT_CURRENT_FOLDER/1.php
    -----------------------------------------------------------------------------------------------------------------

    though this case is not a necessity all the time.
     
  4. tbabgaming

    tbabgaming Registered

    Joined:
    Aug 11, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    after reviewing the cron logs it seems like the crons are running and just not doing anything...


    log

    Nov 28 11:52:01 server11 crond[4125]: (username) CMD (curl http://domain.net/crons/are/4/idiots/1.php)

    so the log shows me the above, and the file can be ran by typing the link in your web browser but does not work as a cron. I rebuilt apache again to insure CURL is installed and it is yet still nothing...


    cron mails say

    /bin/sh: curl: command not found
     
    #4 tbabgaming, Nov 28, 2007
    Last edited: Nov 28, 2007
  5. tbabgaming

    tbabgaming Registered

    Joined:
    Aug 11, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    though the server kept telling me that curl was installed i was able to use

    yum install curl

    this corrected the issue. thanks to those that tried to help.
     
Loading...

Share This Page