在此服务器上找不到请求的 URL /LearnPHP5/learnPHP.php


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

我刚刚下载了 Eclipse for Linux。开始了一个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帖子上看到的有关此内容的所有内容,但是没有任何方法可以纠正这种情况。我整天都在努力解决它。任何帮助将不胜感激。

这是来自我的阿帕奇错误日志:

[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

我愿意接受所有建议。从未见过如此少量代码的困境。

查看日志文件(通常是/var/log/apache2/error.log(,其中 apache 尝试查找您的文件/LearnPHP5/learnPHP.php 。似乎在 www 根目录的路径中存在一些错误。