2014-10-30 61 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/