After Baidu, see the same shoes hint to modify the \phpstudy\apache2\conf\ in the httpd.conf file, the code is as follows
Copy Code code as follows:
<virtualhost *:80>
ServerAdmin webmaster@163.com
DocumentRoot "D:\www"
ServerName ymywz.com
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</VirtualHost>
Note: As a result of the code conflict problem, please change the above double title number to a single title number
When you restart Apache after adding the above code at the bottom of the httpd.conf file, prompt the following:
Windows cannot start Apache2 on the local calculator. For more information, check the system event log. If this is a non-Microsoft service, contact your service manufacturer and refer to the specific service error code 1.
It's a bitter force. I thought it was a computer problem and I reinstalled the phpstudy. After reinstalling, you can start Apache, but this problem occurs again after you add the above code. At this point, I thought there was something wrong with the code you added. After I deleted a restart of manual labor, there was a major discovery:
After deleting the "allowoverride All" code, Apache can be restarted and the domain name is open. I did not study the use of this code, only know that after the deletion can be used.
phpstudy a virtual host with multiple domain names configured locally
After starting Apache2, another problem was encountered: multiple sites could not be opened, prompting 403 error.
I checked on one line of code that was not commented out in the httpd.conf file. After checking and comparing with the online tutorials, I found a problem:
#Include conf/extra/httpd-vhosts.conf the annotation symbol "#" in front of this code is not deleted. The purpose of this code is to open the Httpd-vhosts virtual host file. Once this step is complete, restart Apache so that you can completely open each local domain address.
Note: After modifying the httpd.conf file, you also need to modify the Hosts file to add the local virtual domain name (the reason and in the space DNS resolution to IP is a truth).