Php+apache Environment Configuration (window environment)

Source: Internet
Author: User
Tags phpinfo

recently, the small master engaged in PHP development. The process of how to build PHP7 has been recorded here! Hope there is need, can learn from! (computer must win7 SP1 above,. netframework4) Windows7 Install php7,win7+php7+apache2.4, successfully started.

  First, download PHP7 and apache2.4

First download the PHP7 Windows Compact package and download the http://windows.php.net/download/here. Corresponding version:PHP7 VC14 x86 Thread Safe

I chose this version of PHP7 because it is VC14 compiled, which means that the vc2015 (i.e. VC14) runtime environment needs to be installed, and Apache2.4 is required to run PHP7.

1. vc2015 here to download: http://www.microsoft.com/zh-cn/download/details.aspx?id=48145 run the installation.

It is important to note that the installation of Vc14 must have the 3 services turned on or the installation will fail:

2. Apache2.4 to download :Apache 2.4.17 Win32 http://www.apachelounge.com/download/version number:HT Tpd-2.4.17-win32-vc14.zip

3. Unzip the PHP7 Windows compressed package, Apache2.4, as my path is:

D:\Server\Apache24

D:\Server\Php

D:\Server\WWW (directory where PHP web scripts are stored, documentroot.)

  Second, configure httpd.conf and php.ini:

1. Open apache24/conf/httpd.conf

Modified:serverroot "D:/server/apache24"

Modified:documentroot "d:/Server/www/"

Add: (Note phpinidir item on top) PHP7 processing interface to Apache

phpinidir "d:/server/php"

AddType application/x-httpd-php. php. html. htm

LoadModule php7_module "D:/server/php/php7apache2_4.dll"

2. Configure PHP.ini. Open the PHP directory, copy the 1 php.ini-development, and modify it to php.ini.

Open php.ini, find ; extension_dir = "D:/server/php/ext" , remove the semicolon from the front.

   (You must specify an extension path, otherwise PHP7 will not start.) Normally after opening the Ext extension directory, you can successfully start PHP7 on the command line, if it is still unsuccessful, your PHP path is not added to the environment variable (or your environment variable is used in the old PHP version))

  Third, add Apache24 to the Windows service and start Apache:

cmd command line, go to D Drive, then open Directory, run httpd–k install

D:

Cd D:\Server\Apache24\bin

Httpd–k Install

Httpd–k start

In this way, Apache and PHP7 are started.

Create 1 phpinfo.php files in d:/web/www/

Access: http://127.0.0.1/phpinfo.php actual running results. If you have questions, consult my QQ 857280707 to give you the answer.
(There are also 1 PHP7 integrated environments packaged: HTTP://PAN.BAIDU.COM/S/1QXWJPF2, if you just want to know about it, put it in the D-packing directory. )


This article from the "11022006" blog, reproduced please contact the author!

Php+apache Environment Configuration (window environment)

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.