2014-10-30 64 views
1

我已经建立了一个cron作业使用运行PHP脚本,cron作业curl命令返回404错误页面没有找到

/usr/bin/curl http://www.domain.com/folder/script.php

而且我得到了404页无法通过电子邮件发现,

% 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:[email protected]?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>

我在几个站点使用相同的Cron作业命令,它们都在工作。 请帮我解决这个问题。

谢谢。

+0

有一个问题在这里什么地方? – 2014-10-30 10:03:47

回答

0

尝试通过浏览器访问http://www.domain.com/folder/script.php并查看结果。

确保其没有显示404

+0

它可以通过浏览器访问,没有404错误。 – 2014-10-30 10:29:12

+0

尝试卷曲没有完整的网址。这是curl http://www.domain.com。 – Roni 2014-10-30 10:31:21

+0

我已经试过了'code'curl http:// www.domain.com/folder/script.php'code'。有相同的404错误电子邮件。 – 2014-10-30 10:51:07

0

我设置cron作业如下,这是工作。

/usr/local/bin/php -q /home/btlopsco/public_html/