If it is installed manually, find the apache installation directory:
\apache\conf\httpd.conf //httpd.conf 是个文件,不是文件夹
It can be opened with Notepad or an editor such as editplus.
Related recommendations: "php tutorial"
Search in the file: 80
# Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80
You can use Listen Just change the 80 after 80 to the port you need, 8080.
Then enter http:/localhost:port number in the browser when accessing.
The above is the detailed content of How to change the port in php. For more information, please follow other related articles on the PHP Chinese website!