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 job returns 404 error

Discussion in 'General Discussion' started by Pyone, Oct 29, 2014.

  1. Pyone

    Pyone Member

    Joined:
    Oct 9, 2014
    Messages:
    10
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Website Owner
    I'm trying to run php script via cron job and got 404 error.
    My command is :
    */1 * * * * curl www.domain.com/folder/script.php

    And I got cron email like this :

    Code:
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    104  1982  104  1982    0     0   235k      0 --:--:-- --:--:-- --:--:--  483k
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
      <head>
        <title>404 Not Found</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
            body {
                    font-family: Verdana, Arial, Helvetica, sans-serif;
                    font-size: 12px;
                    background-color:#367E8E;
                    scrollbar-base-color: #005B70;
                    scrollbar-arrow-color: #F3960B;
                    scrollbar-DarkShadow-Color: #000000;
                    color: #FFFFFF;
                            margin:0;
            }
            a { color:#021f25; text-decoration:none}
            h1 {
                    font-size: 18px;
                    color: #FB9802;
                    padding-bottom: 10px;
                    background-image: url(sys_cpanel/images/bottombody.jpg);
                    background-repeat: repeat-x;
                    padding:5px 0 10px 15px;
                            margin:0;
            }
            #body-content p {
                    padding-left: 25px;
                    padding-right: 25px;
                    line-height: 18px;
                    padding-top: 5px;
                    padding-bottom: 5px;
            }
            h2 {
                    font-size: 14px;
                    font-weight: bold;
                    color: #FF9900;
                    padding-left: 15px;
            }
        </style>
      </head>
      <body>
        <div id="body-content">
    <!-- start content-->
    
    <!--
     instead of REQUEST_URI, we could show absolute URL via:
     http://HTTP_HOST/REQUEST_URI
        but what if its https:// or other protocol?
    
        SERVER_PORT_SECURE doesn't seem to be used
        SERVER_PORT logic would break if they use alternate ports
    -->
    
    <h1>404 Not Found</h1>
    <p>The server can not find the requested page:</p>
      <blockquote>
        /folder/script.php (port 80)
      </blockquote>
    <p>
        Please forward this error screen to www.domain.com's]
        <a href="mailto:info@on.sg?subject=Error message [] 404 Not Found for /folder/script.php port 80 on Wednesday, 29-Oct-2014 17:34:01 SGT">
        WebMaster</a>.
    </p>
    <hr />
    
    
    <!-- end content -->
        </div>
      </body>
    </html>
    What is the source of this problem?
    I've been using the same command for Cron job and it has worked in other sites.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. Pyone

    Pyone Member

    Joined:
    Oct 9, 2014
    Messages:
    10
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Website Owner
    Yes, it solved the problem. Thank you so much.

    Service provider asked me to try the following :
    I've tried it but got the same 404 error.
    Although, my problem is already solved I'd like to know why this 404 error occurs.

    Thanks
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I suggest consulting with your web hosting provider to have them review the cron job and determine why it's producing a 404 error page. It's difficult to troubleshoot that type of issue without root access.

    Thank you.
     
Loading...

Share This Page