Home>Article>Operation and Maintenance> How to create a local site by modifying the vhosts file in phpstudy

How to create a local site by modifying the vhosts file in phpstudy

藏色散人
藏色散人 Original
2018-11-07 16:17:22 10403browse

This article mainly introduces how to use phpstudy to add a local domain name site under Windows (Create a local site by directly modifying the vhosts-conf file)

phpstudy integration The required version of the package can be downloaded from the following link:

phpstudy2016 stable version download://m.sbmmt.com/xiazai/gongju/89

Download the latest version of phpStudy 2018://m.sbmmt.com/xiazai/gongju/845

Then in the previous article, I have introduced it to youCreate the site domain namethrough the site domain name management menu in phpstudy.

Now we will use another simpler method to teach you how toadd a new site domain nameusing phpstudy.

Step 1: Create a new site folder in the root directory. Here we create the phpzww folder, which contains the specific site program.

How to create a local site by modifying the vhosts file in phpstudy

Step 2: Open other menu options in phpstudy, find and open the configuration filevhosts-conf file.

How to create a local site by modifying the vhosts file in phpstudy

In thevhosts.conf file, copy and paste the code in the following box and modify it to the correctnew site Domain name, andFile directory path, and then click Save.

How to create a local site by modifying the vhosts file in phpstudy

Step 3: Open thehosts fileagain,bind the newly created domain name, here are www.phpzww.cn and phpzww.cn, then click Save.

How to create a local site by modifying the vhosts file in phpstudy

Step 4: Finally restart the phpstudy environment.

How to create a local site by modifying the vhosts file in phpstudy

Then we can access the index file by accessing the new site domain name. If the following content is displayed, it means that we have successfully created the new site domain name.How to create a local site by modifying the vhosts file in phpstudy

This article is about the method of creating a local site in phpstudy. It is simpler than the method introduced before. Of course, you can choose the appropriate method to create a local site according to your own preferences!

The above is the detailed content of How to create a local site by modifying the vhosts file in phpstudy. 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