Home >Backend Development >PHP Tutorial >I use wamp to run the php program. By default, localhost can access it. But if I change it to the local IP, it won't work.
localhost can access the local server
Changing to the local IP will not work, prompting a 403 error
localhost can access the local server
Changing to the local IP will not work, prompting a 403 error
Configure the hosts file 127.0.0.1 localhost ::1 localhost
Assume local IP: 192.168.31.81
hosts file
<code>127.0.0.1 192.168.31.81 </code>
httpd-vhosts.coonf
<code><VirtualHost *:80> DocumentRoot "F:/wamp/www/XXXX/" ServerName 192.168.31.81 <Directory "F:/wamp/www/XXXX/"> Options Indexes FollowSymLinks Order allow,deny Allow from all </Directory> </VirtualHost> </code>