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!

Script runs perfectly manually but not via cronjob

Discussion in 'General Discussion' started by t04st3d151, Jan 30, 2012.

  1. t04st3d151

    t04st3d151 Member

    Dec 31, 2007
    Likes Received:
    Trophy Points:

    I've setup a cronjob for one of my scripts.

    If I tail the cron log file:

    Jan 30 11:53:01 vps crond[7173]: (user) CMD (/usr/bin/php -f /home/user/public_html/cron.php)
    Jan 30 11:54:01 vps crond[8043]: (root) CMD (/usr/bin/php -f /home/user/public_html/cron.php)
    Jan 30 11:54:01 vps crond[8044]: (user) CMD (/usr/bin/php -f /home/user/public_html/cron.php)

    The above shows crontab executing the command, however it doesnt actually run.

    If I manually run - /usr/bin/php -f /home/user/public_html/cron.php it picks it up and works near immediately.

    I've setup the cron under the users cpanel account as well as root to see if it was a permissions issue, but still same issue.

    Any ideas?
  2. storminternet

    storminternet Well-Known Member

    Nov 2, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Please make sure that you have applied 755 permissions to /home/user/public_html/cron.php
    But it will be more clear after checking cron logs. Please check cron logs at /var/log/cron or if you do not have access
    to server then check it with your host.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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