There are generally three situations when the browser cannot open the php file:
Scenario 1: The web page displays blank, press F12, and a 404 error occurs.
Solution:
1. Search for IIS (Internet Information Service) in the start menu and press Enter to enter.
#2. Find the management server option in the operation on the right and select Stop.
Situation: The web page displays HTTP Error 404. The requested resource is not found. Press F12 and a 404 error appears.
Solution:
1. Search for services in the start menu and press Enter to enter
2. Find SQL Server Reporting on the right Services (MSSQLSERVER) option, right-click and select Stop
Case 3: Unable to display the webpage
Solution:
1. In the wamp installation directory Find the D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
file,
2. Then add the following code:
<VirtualHost *:80> ServerAdmin webmaster@dummy-host2.localhost DocumentRoot "D:\wamp\www" ServerName localhost </VirtualHost>
Note: 80 is the port number of wamp, D:\wamp\www is your php storage folder (mine is placed in the www directory),
localhost It is the path name you want to enter in the URL. You can name it whatever you want, 127.0.0.1 is also fine.
3. Save and restart wamp
4. Enter localhost:xx.php in the browser, and the php file can be opened.
The above content is for reference only!
Recommended video tutorial: PHP video tutorial
The above is the detailed content of Solution to the problem that the browser cannot open the php file. For more information, please follow other related articles on the PHP Chinese website!