appach2.4 + PHP7 Configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.