Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: February 20, 2023 12:04AM

Hello,

I hope somebody can help. Having installed Wamp for the first time, I am geting the dreaded 403 error when trying to access localhost. Specifically, "Forbidden - You don't have permission to access this resource".

I know this is a common error, but all the recommended solutions I've seen involve editing httpd.conf. I have tried that. Here's the relevant section from mine:

<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>

This solved nothing. I've seen slight variations on the syntax, which I've also tried. I have also re-installed wamp, but I still get the same 403 error.

Being new to Wamp, I really don't know where to go from here. I've been using xampp for years, so I know my way around Apache and MySQL.

Can anybody help me solve this?

Many thanks!

Andy.

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: February 20, 2023 09:01AM

Hi,

> but all the recommended solutions I've seen involve editing httpd.conf.

httpd.conf must NEVER be modified!

And moreover with directives dating from Methuselah and Apache 2.2!


- 1 READ (and answer) BEFORE YOU ASK A QUESTION

- 2 - Verify that all VC ++ packages are installed and with the latest versions.
To do this, use the tool:
Checks VC++ packages installed
Do not use a previously loaded tool. Make a new download to make sure you are using the correct version.
To download missing packages, do not rely on Microsoft links, they are not reliable, download packages on http://wampserver.aviatechno.net in section Visual C++ Redistribuable Packages
Do not forget that if you have a 64 bit Windows, you must install both 32 and 64 bit versions of each package.
You must install each package "as an administrator", so right-click the exe file and then run as Administrator.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: February 20, 2023 02:42PM

Thanks so much for your help. The tools says all the VC++ packages are installed correctly. I actually had already run the tool and installed the libraries. Sorry, I forgot to mention that in my post.

Any other thoughts_

Thanks!

Andy.

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: February 20, 2023 03:27PM


Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: February 22, 2023 12:25AM

Sorry, didn't see the post asking for these answers:


1 - Windows version used (Specify version number AND whether 32 or 64 bit) Windows 11 64-bit
2 - Version WampServer (Specify version number AND whether 32 or 64 bit) 3.3.0 (64)
3 - Apache Version 2.4.54.2
4 - PHP Version 8.0.26
5 - MySQL Version 8.0.31
5a - MariaDB version if applicable
6 - What color is the WampServer icon (in the notification area of the taskbar) Green

When all goes well it should be green, but it may be red or orange.

If the WampServer icon is NOT GREEN please ensure you have looked at these files :-
a - Apache error log
-- ( wampmanager -> Apache -> Apache error log )
-- ( wampmanager -> Apache -> Apache access log )
b - MySQL error log ( wampmanager -> MySQL -> MySQL log )
b1 - MariaDB error log ( wampmanager -> MariaDB -> Mariadb log )
c - PHP error log ( wampmanager -> PHP -> PHP error log )

Depending on the error, one or all of the above may be empty so also look at
d - The windows event viewer
--- Windows Key + R to launch the run dialog then enter eventvwr.exe and press the OK button
--- - On the left side of the windows click 'Windows Logs -> Applications'
--- - Look for the names 'Apache Service' or 'MySQL' in the Source column which have a error symbol in the first column.

If you find any errors that you cannot fix for yourself please post the COMPLETE EXACT error message in your question.


7 - In the file c:\Windows\System32\drivers\etc\hosts, what are the active lines?
* Active means no # at the beginning of the line.

127.0.0.1 localhost
::1 localhost


If the WampServer icon is green:

8 - Do you have access to localhost (Homepage WampServer)? No
8a - If so, is there an error message at the bottom of the page? No

9 - Do you have access to phpMyAdmin? Yes

10 - If you refer to an error message, please include the EXACT wording of the error in your post

403 Forbidden - you do not have access to this resource

11 - If you use an Antivirus and / or Firewall, please include the names of these Windows Defender
12 - What is the full path to the installation of WampServer (eg D:\wamp\) i:\wamp
13 - If you have one or more Virtual Hosts defined, please show their definition(s)

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: February 22, 2023 09:00AM

Hi,

Did you restore httpd.conf and httpd-vhosts.conf to their original state?

For your information, these two files - in their state just after installation - are saved in the folder

wamp64\bin\apache\apache2.4.55.2\conf\original\wampserver\

Weird! You have access to 'http://localhost/phpmyadmin/' but not to 'http://localhost/'

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: February 23, 2023 04:52PM

Yes, files restored to original (I'd only edited httpd.conf).

Yes, I thought it strange that phpmyadmin runs but not localhost!

Any idea where I go from here?

I am very grateful for your help

Andy.

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: March 02, 2023 02:46PM

Does anybody have any ideas that may help me get localhost running? Thank you!

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: March 02, 2023 07:36PM

Hi,

Try with another browser with 'http://localhost/' in url bar

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: March 05, 2023 04:41PM

Hi Otomatic,

I receive the "Access Denied" message both in Chrome and Edge.

Any idea where we go from here?

Many thanks for your help!

Andy.

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: March 05, 2023 06:28PM

Hi,

By rereading all your messages, there is still something that challenges me!
'http://localhost/' => access denied
'http://localhost/phpmyadmin/' => OK

Then, you wrote :
<Directory "c:/wamp/www/">
and
12 - What is the full path to the installation of WampServer (eg D:\wamp\) i:\wamp

If Wamp is well installed in i:/wamp, it should be <Directory "i:/wamp/www/">
because, originally, in httpd.conf, there is : <Directory "${INSTALL_DIR}/www/">

It seems that you have not put back the original httpd.conf file.
To do this :

Left-Click -> Apache -> Apache Settings -> Wampserver settings for Apache -> Allow Apache files restoration
to check it
wait for refresh

Left-Click -> Apache -> Apache Settings -> Restore files saved at the installation of Apache -> Restore httpd.conf
wait for refresh

Left-Click -> Apache -> Apache Settings -> Restore files saved at the installation of Apache -> Restore httpd-vhosts.conf
wait for refresh

Right-Click -> Restart from zero

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: March 07, 2023 01:04AM

Hi,

Many thanks. I have restored the files - I thought I had, but obviously not - and all services are running. But I still get the message "Forbidden - you don't have permission to access this resource" when trying localhost, and phpMyAdmin is still running correctly! I don't understand it either!

I get the error in Chrome and Edge.

Andy

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: March 07, 2023 09:24AM

Hi,

- Does 'http://127.0.0.1/' work?

- Do you use a VPN or a proxy?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: March 10, 2023 10:34PM

Hi Otomatic,

No, it doesn't work.

I'm not using a VPN nor a proxy.

I don't know if it's relevant, but I was using Xampp before I (tried to!) migrate to Wamp. Is it possible that something is still kicking around from Xampp that is causing the problem? Just a thought!

Thanks so much for your help!

Andy.

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: March 11, 2023 08:54AM

Hi,

Check that there is no path to a PHP version or to the old Xampp installation in the Windows environment variables. If there is, delete them and restart the machine.

It is also possible that there are traces of Xampp in the registry that have not been removed by the uninstallation, do a search on xampp and remove the traces. It would be better to make a backup of the registry before!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: March 11, 2023 04:05PM

Hi! There were no environmental variables set, but I did find 2 remaining registry entries for xampp. Removing them, however, made no difference. Well at least we can rule that out now.

Any other ideas?

Thanks!

Andy.

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: Otomatic (Moderator)
Date: March 11, 2023 04:26PM

I confess I have no idea what to do except to try with Firefox

I'm sorry, but I'm at a loss!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cannot Solve 403 Error
Posted by: AndyTheAstronomer (---.masmovil.com)
Date: March 12, 2023 03:04PM

Well I would like to say thank you so much for all the help you've given me in trying to solve this strange problem. I am going to try with Firefox later, and I will let you know what happens.

I really do appreciate your time and your help.

All the best

Andy.

Options: ReplyQuote


Sorry, only registered users may post in this forum.