How to create a local VM using php in winxp apache
Last Update:2018-12-08
Source: Internet
Author: User
1 In C: \ WINDOWS \ system32 \ drivers \ etc \ hosts
Add the following code:
127.0.0.1 localhost
127.0.0.1 x.test.com x.test1.com x.test2.com
Note: x.test.com (assuming DNS)
2 In E: \ WAMP \ Apache2.2 \ conf \ extra \ httpd-vhosts.conf
Modification content:
NameVirtualHost *
<VirtualHost *>
ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www
ServerName localhost
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common
</VirtualHost>
<VirtualHost *>
ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www/app (application directory)
ServerName test.com
ServerAlias x.test.com admin.teeume.com
ErrorLog logs/x.test.com-error_log
CustomLog logs/x.test.com-access_log common
</VirtualHost>
<VirtualHost *>
ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www/app/assets
ServerName x.test1.com
ErrorLog logs/img.test1.com-error_log
CustomLog logs/img.test1.com-access_log common
</VirtualHost>
# Self-built directory
<VirtualHost *>
ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www/test/assets
ServerName x.test2.com
ErrorLog logs/img.test2.com-error_log
CustomLog logs/img.test2.com-access_log common
</VirtualHost>
======================================
3. Check whether php is associated.
Find httpd. conf in E: \ WAMP \ Apache2.2 \ conf
Check whether the following code exists at the end:
########### Start for php5
LoadModule php5_module E:/WAMP/php5/php5apache2_2.dll
PHPIniDir E:/WAMP/php5
AddType application/x-httpd-php. php. phtml. php5
AddType application/x-httpd-php-source. phps
##### End for php5
If not, add it as code.
4. Search
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
Change # Virtual hosts
Include conf/extra/httpd-vhosts.conf
5. Search <IfModule dir_module>
DirectoryIndex index.html
</IfModule>
Change <IfModule dir_module>
DirectoryIndex index.html. var index. php
</IfModule>
6. Find <Directory "E:/WAMP/Apache2.2/htdocs">
Change to <Directory "E:/WAMP/www"> (www is the apache application Directory)
7. Find DocumentRoot "E:/WAMP/Apache2.2/htdocs"
Change to DocumentRoot "E:/WAMP/www"
8. Find ServerRoot "E:/XXX/Apache2.2" (apache installation directory)
Change to ServerRoot "E:/WAMP/Apache2.2" (apache Server Directory)
9 x.test.com x.test1.com x.test2.com
Enter the preceding three items for testing.