Home  >  Article  >  Backend Development  >  How to set a virtual domain name in php

How to set a virtual domain name in php

王林
王林Original
2020-11-09 11:48:042482browse

How to set a virtual domain name in php: 1. Edit the httpd.conf file and uncomment the virtual hosts; 2. Edit the httpd-vhosts.conf file and configure the virtual domain name; 3. Redirect; 4. Bind hosts ;5. Restart the apache server.

How to set a virtual domain name in php

The specific steps are as follows:

(Learning video recommendation: java video tutorial)

1 , find the apache configuration file httpd.conf

How to set a virtual domain name in php

2, in D:\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf

How to set a virtual domain name in php

3. Redirect, otherwise a 403 error will occur when accessing other projects

How to set a virtual domain name in php

4. Find C: \Windows\System32\drivers\etc\hosts

How to set a virtual domain name in php

#5. Finally, restart the apache server

so that the virtual domain name you configured can be accessed, use "127.0 .0.1" or "localhost" can access other projects!

Related recommendations: php training

The above is the detailed content of How to set a virtual domain name in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn