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 issues

Discussion in 'General Discussion' started by Matthew Yarro, Oct 20, 2014.

  1. Matthew Yarro

    Matthew Yarro Registered

    Joined:
    Oct 20, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lindon, Utah, United States
    cPanel Access Level:
    Reseller Owner
    I have looked and read through quit a few posts, but I just can't seem to get my cron to work.

    I have tried:

    /usr/local/bin/php -q public_html/cron/reset-security-codes.php

    Which says it cannot open the file input

    and I have tried:

    /usr/local/bin/php5 -q public_html/cron/reset-security-codes.php

    Which says that /usr/local/bin/php5 doesn't exist

    and this:

    -q /public_html/cron/reset-security-codes.php

    Which results in:

    public_html/cron/reset-security-codes.php: line 1: ?php: No such file or directory
    public_html/cron/reset-security-codes.php: line 3: require_once: command not found
    public_html/cron/reset-security-codes.php: line 4: require_once: command not found
    public_html/cron/reset-security-codes.php: line 6: require_once: command not found
    public_html/cron/reset-security-codes.php: line 9: =UPDATE user SET user_auto_login = 'no': command not found
    public_html/cron/reset-security-codes.php: line 10: syntax error near unexpected token `$query_is'
    public_html/cron/reset-security-codes.php: line 10: ` mysql_query($query_is) or die('Invalid query: ' . mysql_error());'


    Which I assume means that it can find the cron file but doesn't understand it's PHP because I removed the first part of the cron equation. But when I put it in there:

    /usr/local/bin/php -q public_html/cron/reset-security-codes.php

    It says it cannot open the file input.

    I am at a bit of a loss. Any help would be helpful and appreciated.
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    you have forgotten some parts

    try


    /usr/local/bin/php -q /home/username/public_html/cron/reset-security-codes.php
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,667
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, it looks like you are missing the "/" before public_html in the commands you referenced. Let us know if the suggested entry in the previous post is helpful.

    Thank you.
     
  4. Matthew Yarro

    Matthew Yarro Registered

    Joined:
    Oct 20, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lindon, Utah, United States
    cPanel Access Level:
    Reseller Owner
    Figured out a few issues that were causing the error to occur and thought I would share for anyone else pulling hair out of their head:

    1). I had to change the permissions to both the folder contain the file and the file itself. They are currently set at 755 (folder) and 644 (file).

    2). The pathing for PHP includes was causing an error, but it wasn't showing up in the log. Instead of using relative paths, I used a fully qualified path: /home/username/public_html/settings/settings-config.php

    With all the other help--thank you--it is working like a gem.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,667
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page