Home >Backend Development >PHP Tutorial >wampserver solves 'cannot switch online' and running '404 problem', wampserver404_PHP tutorial
Use wampserver2.2 for the first time installation, because the applications installed on each computer or the computer model are different. The following problem occurred:
1. After installation, you cannot switch between "Server Online" or "Server Offline"
2. After setting up the site, a 404 error occurs when running the written code
Baidu has many solutions to these problems. I have tried them myself, but some of them don't work.
So I will nag you again:
There are two reasons for these problems:
1. The computer’s default port 80 is already occupied
2. An error occurred during wampserver configuration
For the first question, just change the product number to 8080 end product:
Open the wampserver/apache/httpd.conf file and modify the port number:
After making the changes, restart the apache server and you will find that the wampserver icon changes from orange to green, indicating that the server is working normally.
At this time, a 404 problem will occur when running the code through the server:
This is caused by a problem that is easily overlooked. The default port number of the computer is 80. Now that the apache port number has been changed to 8080, it must also be used when setting up the site and configuring the server. Set the port number:
After setting it up in this way, there will be no errors when running the code again;