Cron + PHP Error

Discussion in 'PHP' started by xrvel, Jan 27, 2009.

  1. #1
    I have a cron script. It was working fine until few days ago.

    When i use this cron command:
    curl http://example.com/cron.php
    Code (markup):
    I got "500 internal server" error as the result.

    When i use this cron command instead
    php /www/dir1/dir2/abs_path_etc/cron.php
    Code (markup):
    I got "MySQL server has gone away" message.
    It just a simple SQL query, less than 150 characters, just updating some rows.

    Does mysql connection can not be used on the second cron command?

    ----------------------------

     
    xrvel, Jan 27, 2009 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    check your error log from cpanel and let us know !
     
    crivion, Jan 27, 2009 IP
  3. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #3
    Here is my common error log -- taken from cpanel
    
    [Tue Jan 27 05:03:01 2009] [error] [client 74.53.*.*] File does not exist: /{path}/public_html/osyt.com/500.shtml
    [Tue Jan 27 04:50:02 2009] [error] [client 195.194.*.*] File does not exist: /{path}/public_html/osyt.com/favicon.ico
    
    Code (markup):
     
    xrvel, Jan 27, 2009 IP
  4. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #4
    try one of those
    php /www/dir1/dir2/abs_path_etc/cron.php /dev/null 2>&1
    php -f /www/dir1/dir2/abs_path_etc/cron.php /dev/null 2>&1
    php -g /www/dir1/dir2/abs_path_etc/cron.php /dev/null 2>&1
    wget /www/dir1/dir2/abs_path_etc/cron.php /dev/null 2>&1
     
    crivion, Jan 27, 2009 IP
    xrvel likes this.
  5. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #5
    Thanks for the tips :)
    I'll try some of them.
     
    xrvel, Jan 27, 2009 IP