Step 1. First open the httpd.conf file inside the apache2.2\conf. Found in:
ServerRoot, change to the directory where Appache is located
Step two add an extension that supports PHP7 after LoadModule
3. In order for Apache to set index.php as the default page
<IfModule dir_module> DirectoryIndex index.html</IfModule>
Revision changed to
<IfModule dir_module> DirectoryIndex index.html index.php</IfModule>
在一堆LoadModule下面添加
# PHP7 Support
LoadModule Php7_module E:/php-7.0.10-win32-vc14-x86/php7apache2_4.dll
AddType application/x-httpd-php. php. html. htm
# Configure the path to PHP.ini
Phpinidir "E:/php-7.0.10-win32-vc14-x86"
Step three Find <Directory>
Modify all <Directory> paths to the directory where the Appache is located
Step Four
LoadModule Rewrite_module modules/mod_rewrite.so This line, the "#" in front of him to remove.
Include conf/extra/httpd-vhosts.conf to remove the "#" from his front. (Very critical)
: Save the file. Then go to the apache2.4\conf\extra inside of the httpd-vhost.conf file open:
will be inside of:
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "c:/apache2.2/docs/dummy-host2.x"
ServerName dummy-host2.x
Errorlog "Logs/dummy-host2.x-error.log"
Customlog "Logs/dummy-host2.x-access.log" common
</VirtualHost>
Delete, and then add a virtual subdirectory
<virtualhost *:80>
DocumentRoot "E:/think"
ServerName www.hgj.com
<directory "E:\think" >
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
How many of these virtual directories are configured.
and then save.
Admin privileges open cmd, register Apache service, registration will appear in
Apache Service Monitor inside.
e:\Apache24\bin\httpd.exe -k install
Step 5: Locate the Hosts file inside the C:\WINDOWS\SYSTEM32\DRIVERS\ETC and open:
You can specify more than one virtual name, such as:
127.0.0.1 www.hgj.com.
Save.
Done.
Restart Apache. Mine is Appserv. Reboot. Then write in the browser:
Http://localhostes. Enter to try.
It's interesting. If you feel bad
appach2.4 + PHP7 configuration