Home >Backend Development >PHP Tutorial >Why Am I Getting a '403 Forbidden” Error When Trying to Access My WAMP Server From My Local Network?
Accessing WAMP Server from Local Network with Error "403 Forbidden"
Unable to access your WAMP server from local networks despite following numerous online solutions, resulting in a persistent "403 Forbidden" error message? This issue can be frustrating, but here's a comprehensive guide to resolve it.
For WAMPServer Versions 2.5 and Below
WAMPServer is inherently configured for secure development server settings, restricting access from external machines. To allow access from your local network, edit the httpd.conf file:
# onlineoffline tag - don't remove Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from ::1 Allow from localhost
Change to:
# onlineoffline tag - don't remove Require local Require ip 192.168.0
Require local allows access from 127.0.0.1, localhost, and ::1, while Require ip 192.168.0 permits access from any IP on your internal network, including the server's actual IP address.
For WAMPServer Version 3 and Above
In these versions, Virtual Hosts are pre-defined for localhost, so modifications must be made to the Virtual Host definition config file (httpd-vhosts.conf):
<VirtualHost *:80> ServerName localhost DocumentRoot D:/wamp/www <Directory "D:/wamp/www/"> Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>
Amend to:
<VirtualHost *:80> ServerName localhost DocumentRoot D:/wamp/www <Directory "D:/wamp/www/"> Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> </VirtualHost>
Restart Apache
After making these changes, restart Apache to apply the settings.
Firewall and McAfee Exceptions
Ensure that firewall and McAfee exceptions have been configured to allow traffic on the specified port, typically 80.
Additional Considerations
The above is the detailed content of Why Am I Getting a '403 Forbidden” Error When Trying to Access My WAMP Server From My Local Network?. For more information, please follow other related articles on the PHP Chinese website!