2014-12-06 323 views
-1

我剛剛下載了Eclipse for Linux。開始一個PHP教程,立即遇到了障礙。該代碼是小:在此服務器上找不到請求的URL /LearnPHP5/learnPHP.php

<?php 
echo 'Hello PHP World!'; 

當我運行它的Web應用程序,我得到:

Not Found 

The requested URL /LearnPHP5/learnPHP.php was not found on this server. 

Apache/2.4.7 (Ubuntu) Server at localhost Port 80 

我已經安裝了Eclipse的Web開發工具,安裝在我的Linux PHP。和Apache2運行。我也有與NetBeans相同的問題。有誰知道我爲什麼得到這個錯誤?我曾嘗試在SO帖子上看到的所有內容,但沒有任何補救措施。我一直在努力整理一下。任何幫助將不勝感激。

這是我的Apache錯誤日誌:

[Fri Dec 05 16:39:17.808812 2014] [mpm_event:notice] [pid 8660:tid 140438963517312] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations 
[Fri Dec 05 16:39:17.808955 2014] [core:notice] [pid 8660:tid 140438963517312] AH00094: Command line: '/usr/sbin/apache2' 
[Fri Dec 05 16:39:31.664085 2014] [mpm_event:notice] [pid 8660:tid 140438963517312] AH00491: caught SIGTERM, shutting down 
[Fri Dec 05 16:39:32.768582 2014] [mpm_prefork:notice] [pid 9978] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations 
[Fri Dec 05 16:39:32.768695 2014] [core:notice] [pid 9978] AH00094: Command line: '/usr/sbin/apache2' 
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message 

我向所有人開放的建議。從來沒有見過如此少量代碼的這種困境。

+0

這是likley一個配置...你在Apache的'DOCUMENT_ROOT'是什麼?你的'LearnPHP'文件在目錄中嗎?注意:如果你使用的是Apache的默認設置,那麼你的'DOCUMENT_ROOT'可能是Ubuntu上的'/ var/www'--所以你係統上的文件路徑應該是'/ var/www/LearnPHP5' – prodigitalson 2014-12-07 01:25:57

+0

我是抱歉。我對此很新。但是index.php不在/ var/www中。我確實嘗試將它保存在那裏,但由於我不是root用戶而被拒絕了權限。對不起,聽起來很愚蠢。 – Landslyde 2014-12-07 02:42:37

回答

0

查看日誌文件(通常爲/var/log/apache2/error.log),其中apache嘗試查找您的文件/LearnPHP5/learnPHP.php。 這似乎是在www根目錄路徑中的一些錯誤。

+0

我把我的文章中的一些apache日誌用於查看。我沒有經歷任何這方面的經驗。所以如果有人看到我需要做的事情,請告訴我。謝謝。 – Landslyde 2014-12-07 01:24:23

相關問題