0

Windows Version: Windows 8 Pro 64-bit XAMPP Version: 5.5.19

I just moved a local system on XAMPP from a Windows XP machine to Windows 8.1. On the original system if I browse to http://localhost/w/index.php/Home, '/Home' gets passed to the index.php file which treats it equivalently to '?title=Home', but on the new system the browser shows:

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 

And in Apache (error.log) I see:

[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' is not a file, it's supposed to be passed to index.php

Thanks for any help; I'm not familiar enough with .conf files to understand what could be causing the error.

Edit (reply to Rhythem Aggarwal):

Going directly to localhost/ also gives Access forbidden!. and [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

while going to http://localhost/w/index.php?title=Home works fine.

I tried adding to httpd-xampp.conf:

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

as per the other answer at Xampp Access Forbidden php but nothing changes.

Edit some more to show XAMPP display:

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

Another edit:

When I view Properties of c:\xampp\htdocs in the Windows 8.1 file manager it shows me the Read Only box checked and even if I uncheck it and then allow it to update all files and subfolders, when I look back at the Properties it says Read Only again.

Community
  • 1
  • 1
eth
  • 31
  • 1
  • 6

3 Answers3

1

The answer seems to be that I had an old experimental .htaccess file lying around in the htdocs folder. Under Windows XP the file had apparently been ignored, but now on Windows 8.1 it was being used and interfering.

eth
  • 31
  • 1
  • 6
0

Form my understanding, index.php is a file that typically is in the htdocs folder. This file (when unaltered i.e. as is in the fresh install of xampp) redirects you to xampp home screen. 1. Did you try typing the link that i mentioned? 2. If yes, then this typically is a case of Xampp's changed security policy , assuming that while upgrading to windows 8.1 you upgraded your xampp to a newer version too.

Please follow this link in case you are on step two of what i mentioned.

Xampp Access Forbidden php

In case none of this works for you, please update me.

Community
  • 1
  • 1
Rhythem Aggarwal
  • 346
  • 2
  • 15
  • try browsing to localhost/ directly in your browser (for step 1, my bad forgot the link) – Rhythem Aggarwal Dec 01 '14 at 15:14
  • could you please add a screenshot here of both the screens, apache and the web browser ??? – Rhythem Aggarwal Dec 01 '14 at 16:20
  • one quick question, did you try to restart your xampp server after you made the change to the conf file? without a restart the new code would not take any effect – Rhythem Aggarwal Dec 01 '14 at 16:22
  • Thank you. Yes I restarted Apache after each change. But what can I show in the screenshot, more than what I wrote in text? (It's easier for me to just paste text here) – eth Dec 01 '14 at 16:31
  • Ok, just gimme a few seconds to figure this out using my configurations. – Rhythem Aggarwal Dec 01 '14 at 16:33
  • one more quick information, could you please paste the content of index.php file here? That code would solve the /home problem per se – Rhythem Aggarwal Dec 01 '14 at 16:44
  • index.php is MediaWiki's main index.php: https://doc.wikimedia.org/mediawiki-core/master/php/html/index_8php_source.html – eth Dec 01 '14 at 16:47
  • # AllowOverride All # Deprecated # Order Allow,Deny # Deprecated # Allow from all # Deprecated Require all granted # << New way of doing it Not sure if this would work on your enviornment or not. – Rhythem Aggarwal Dec 01 '14 at 17:30
0

eth said it already: The answer seems to be that I had an old experimental .htaccess file lying around in the htdocs folder. Under Windows XP the file had apparently been ignored, but now on Windows 8.1 it was being used and interfering.

Try with this code below, add it in your httpd-xampp.conf file:

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

Hope this helps you. (Thanks to Tho Vo.)

Community
  • 1
  • 1
Suriyaa
  • 2,222
  • 2
  • 25
  • 44