php 在此服务器上找不到请求的 URL。阿帕奇

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9997345/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 08:03:26  来源:igfitidea点击:

The requested URL was not found on this server. Apache

phpapache

提问by Ilya Shpakovsky

I'm install apache server and php on Windows 7 and configured its. But when i'm trying to load php_test.php page(localhost/php_test.php) i get an error:

我在 Windows 7 上安装了 apache 服务器和 php 并配置了它。但是当我尝试加载 php_test.php 页面(localhost/php_test.php)时,我收到一个错误:

Not Found

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

未找到

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

In httpd.conf i've written next:

在 httpd.conf 中我写了下一个:

ServerName localhost

DocumentRoot "D:/project/"

<Directory "D:/project/">
   Options Indexes Includes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

AddType application/x-httpd-php .php
LoadModule php5_module "C:/php/php5apache2_2.dll"
PHPIniDir "C:/php"

What is the problem? I can provide any information from httpd.conf and php.ini if this is need.

问题是什么?如果需要,我可以提供来自 httpd.conf 和 php.ini 的任何信息。

采纳答案by Ilya Shpakovsky

Fixed. When I've installing appache I've written wrong server name. I was confused that in httpd.conf server name was right (localhost) but still wasn't worked.

固定的。当我安装 appache 时,我写错了服务器名称。我很困惑 httpd.conf 中的服务器名称是正确的(本地主机)但仍然没有工作。

UPD (for commentators)

UPD(评论员)

I fix it by reinstall apache server. My mistake was because of i enter wrong server name during installation (seems first time i wrote ip adress). I don't remember what step was it. I reinstall server, wrote "localhost" as server name and it works.

我通过重新安装apache服务器来修复它。我的错误是因为我在安装过程中输入了错误的服务器名称(似乎是我第一次写 IP 地址)。不记得是哪一步了。我重新安装服务器,将“localhost”写为服务器名称并且它可以工作。