xampp Windows 8.1 (20023)给定路径位于根路径上方


xampp Windows 8.1 (20023)The given path was above the root path

Windows

版本: Windows 8 Pro 64 位XAMPP版本:5.5.19

我刚刚将XAMPP上的本地系统从Windows XP机器移动到Windows 8.1。在原始系统上,如果我浏览到http://localhost/w/index.php/Home,"/Home"被传递到索引.php文件,该文件将其等效地视为"?title=Home",但在新系统上,浏览器显示:

Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.19 

在阿帕奇(错误.log(中,我看到:

[core:error] [pid ...:tid ...] (20023)The given path was above the root path: [client ::1:...] AH00127: Cannot map GET /w/index.php/Home HTTP/1.1 to file

'/Home' 不是一个文件,它应该传递给索引.php

感谢您的任何帮助;我对 .conf 文件不够熟悉,无法了解可能导致错误的原因。

编辑(回复Rhythem Aggarwal(:

直接转到本地主机/也会得到Access forbidden![core:error] [pid 3408:tid 1732] (20023)The given path was above the root path: [client ::1:52491] AH00127: Cannot map GET / HTTP/1.1 to file

而去http://localhost/w/index.php?title=Home工作正常。

我尝试添加到httpd-xampp.conf:

<Directory "C:/xampp/htdocs"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all Require all granted </Directory>

根据Xampp Access Forbidden php的另一个答案,但没有任何变化。

再编辑一些以显示 XAMPP 显示:

Initializing Control Panel
18:00:36  [main]    Windows Version: Windows 8 Pro  64-bit
18:00:36  [main]    XAMPP Version: 5.5.19
18:00:36  [main]    Control Panel Version: 3.2.1  [ Compiled: May 7th 2013 ]
18:00:36  [main]    Running with Administrator rights - good!
18:00:36  [main]    XAMPP Installation Directory: "c:'xampp'"
18:00:36  [main]    Checking for prerequisites
18:00:36  [main]    All prerequisites found
18:00:36  [main]    Initializing Modules
18:00:36  [main]    Enabling autostart for module "Apache"
18:00:36  [main]    Enabling autostart for module "MySQL"
18:00:36  [main]    Starting Check-Timer
18:00:36  [main]    Control Panel Ready
18:00:36  [Apache]  Autostart active: starting...
18:00:36  [Apache]  Attempting to start Apache app...
18:00:36  [mysql]   Autostart active: starting...
18:00:36  [mysql]   Attempting to start MySQL app...
18:00:37  [Apache]  Status change detected: running
18:00:37  [mysql]   Status change detected: running
18:09:27  [Apache]  Attempting to stop Apache (PID: 2928)
18:09:27  [Apache]  Attempting to stop Apache (PID: 2432)
18:09:28  [Apache]  Status change detected: stopped
18:09:31  [Apache]  Attempting to start Apache app...
18:09:31  [Apache]  Status change detected: running

另一个编辑:

当我在 Windows 8.1 文件管理器中查看 c:''xampp''htdocs 的属性时,它向我显示选中的"只读"框,即使我取消选中它,然后允许它更新所有文件和子文件夹,当我回顾属性时,它再次显示只读。

答案似乎是我在htdocs文件夹中有一个旧的实验性.htaccess文件。在Windows XP下,该文件显然被忽略了,但现在在Windows 8.1上,它被使用并干扰了。

形成我的理解,index.php 是一个通常位于 HTDOCS 文件夹中的文件。此文件(未经更改时,即在全新安装的 xampp 中一样(会将您重定向到 xampp 主屏幕。1.您是否尝试输入我提到的链接?2.如果是,那么这通常是Xampp更改安全策略的情况,假设在升级到Windows 8.1时,您也将xampp升级到了较新版本。

如果您正在我提到的第二步,请点击此链接。

Xampp Access Forbidden php

如果这些都不适合您,请更新我。

eth已经说过了:答案似乎是我在htdocs文件夹中有一个旧的实验性.htaccess文件。在Windows XP下,该文件显然被忽略了,但现在在Windows 8.1上,它被使用并干扰了。

尝试使用下面的代码,将其添加到您的httpd-xampp.conf文件中:

<Directory "C:/xampp/htdocs/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order Deny,Allow
        Allow from all
        Require all granted
</Directory>

希望这对你有帮助。(感谢托沃