Wampserver modify the root directory

The default root directory of wampserver is under the www folder

The method of modifying the root directory is as follows:

1. Create a new folder in the location where you plan to store the project or code (I built it in C:/MyProject)

2. Open the httpd.conf file (this file is located in bin/apache/apache2.4.27/conf/ or when running wampserver, left-click the icon and mouse over Apache, you can see it)

Search documentroot (default path address) and directory (default permission path address)

 Modify the content behind documentroot and directory to the address of the new folder

3. Restart the wampserver server and test

For example: create a new index.php file in the /MyProject/ folder, and write phpinfo() in the file

Open the browser test, enter localhost/index.php

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325227490&siteId=291194637