Windows Server Installation configuration PHP7.0 environment graphics and text tutorial

Source: Internet
Author: User
Tags iis ini php file php script php website phpinfo vc9 versions

Download and configure the Windows environment php7.0,2015 year September downloadable PHP5.4 to 7.0, this time using the latest PHP version 7.0. and "php 7.0.0 RC 1", "php 7.0.0 RC 2" is a version of the development, in the production environment to pay attention to, stable version is PHP5.6.13.

Confirm Microsoft Visual C + + version

Microsoft Visual C + + versions are critical, unlike PHP downloaded from the Microsoft Visual C + + version.

The left column of PHP's official website has the following comments.

VC9, VC11 & VC14
More recent versions of PHP are built with VC9, VC11 or VC14 (Visual Studio 2008, or or 2015 compiler respectively) and Include improvements in performance and stability.
–the VC9 builds require to have the Visual C + + redistributable for Visual Studio 2008 SP1 or x86 x64
–the VC11 builds require to have the Visual C + + redistributable for Visual Studio x86 or x64
–the VC14 builds require to have the Visual C + + Redistributable for Visual Studio 2015 x86 or x64 installed
Select the downloaded PHP version based on the Microsoft Visual C + + version.

Vc9:microsoft Visual C + + 2008
Vc11:microsoft Visual C + + 2012
Vc14:microsoft Visual C + + 2015

Click on the "Start"->"Control Panel">->"Uninstall program" To view the version of Microsoft Visual C + + that is now available.

The Microsoft Visual C + + version is 2015, so you must select the PHP file that VC14 starts.

Download PHP7.0

Download from the following PHP website.


The "php 7.0.0 RC 2" is written with "windows source and binaries can is found on".

Download source access to the following URL.
The 32-bit

PHP7.0 (7.0.0RC2) has "vc14 x86 Non thread safe", "vc14 x86 thread safe",64 bit "VC14 x64 Non thread safe", "vc14 x64 Thread safe". The use of the environment is Windows Server2008 64-bit so choose to download 64-bit "VC14 x64 Thread safe", people based on their actual environment to choose the download source files (before downloading again to remind everyone to note VC9, VC11, VC14 is selected according to the Microsoft Visual C + + version of the Windows environment, and you cannot download VC14 PHP files if Microsoft Visual C + + 2012. )。

It is important to have the following considerations in the left-hand column.

If you are are using PHP as FastCGI with IIS your should use the Non-thread Safe (NTS) versions of PHP.
Please use the Apache builds provided by Apache Lounge. They provide VC9, VC11 and VC14 builds of Apache for x86 and x64. We use their binaries to build the Apache Sapis.
If you are are using PHP as module with Apache builds from (not recommended) your need to use the older VC6 The PHP compiled with the legacy Visual Studio 6 compiler. Do don't use vc9+ versions of PHP with the binaries.
With Apache and have to use the Thread Safe (TS) versions of PHP.
This time PHP is used in an environment where Apache is a Web server. Apache can be downloaded in Apache Lounge (Specific download method reference download Apache2.4.16, installation method reference installation Apache2.4.16).
PHP has "non Thread safe", "thread safe" version, where "thread safe" version is used.

Click the zip "vc14 x64 Thread Safe (2015-sep-04 02:40:39).

Click "Save" to download to any directory and complete the download steps for PHP.

Install PHP7.0

Then proceed to the installation steps for PHP. After you extract the downloaded files, store them in any directory to complete the installation. This time the installation to "c:\middleware\php".

All the files required to run PHP are in that directory.

1) Add PHP module

First confirm the path to the PHP module.

In the "httpd.conf" file, look for parts of the "dynamic Shared Object (DSO) support". The default is near 61 lines.
and append the following line at the end.
LoadModule Php7_module C:/middleware/php/php7apache2_4.dll
# Dynamic Shared Object (DSO) Support # to is able to use the
functionality of a module which is built as a DSO
# have to place corresponding ' LoadModule ' lines at this location so the
# directives contained in it are act Ually available _before_ They are used.
# statically compiled modules (those listed by ' httpd-l ') does not need
Example: #
LoadModule foo_module modules/
LoadModule access_compat_module
LoadModule actions_module modules/ · • •
#LoadModule Xml2enc_module modules/
LoadModule php7_module c:/middleware/php/php7apache2_4.dll
After appending the above configuration, the PHP module will be read when Apache starts.

2) Login Extension

Associate PHP's extension (. php) with PHP. For example, when accessing "", it is not the sample.php content that is returned to the browser, but the execution result of the PHP script sample.php documented.

Search for "addtype" in the "httpd.conf" file. The default is near 404 lines, with the following 2 lines appended.
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
    # Typesconfig points to the file containing the ' list of mappings from
    # filename extension to Mime-type.
    Typesconfig conf/mime.types

    AddType allows you-add to or override the MIME configuration
    # file S Pecified in Typesconfig for specific file types.
    #AddType application/x-gzip tgz #
    addencoding allows to have certain browsers uncompress
    # inf Ormation on the fly. Note:not all browsers support this.
    #AddEncoding x-compress. Z
    #AddEncoding x-gzip. gz. tgz
    If The addencoding directives above are commented-out, then you
    # p Robably should define those extensions to indicate media types:
    AddType application/x-compress. Z
    AddType application/x-gzip gz. tgz
addtype application/x-httpd-php. php
    AddType Application/x-httpd-php-source. Phps· • •
After you append the above 2 lines, the PHP program will process when accessing the. php file with the extension.

3 Specifies the php.ini profile path (phpinidir)

First, verify that the php.ini file directory is stored.

In the "httpd.conf" file, specify the directory of the PHP configuration file php.ini, which is added to the end of the "httpd.conf" file.
Phpinidir "c:/middleware/php"
Apache will refer to the php.ini file in the Phpinidir directory.

4 confirm the operation of PHP

PHP-related Apache configuration is complete. Make a simple php script file here to verify that the configuration is correct. Don't forget to restart Apache after changing the configuration file.

Open the text editor and append the following.
Phpinfo ();

Quiet named "phpinfo.php", saved to the Apache Htdocs directory.

Open the browser input "http://localhost/phpinfo.php". If the following pages display PHP-related information, Apache can normally invoke PHP.

All right, that's all. The above is about Windows Server installation configuration PHP7.0 environment graphics and text tutorial, here is the installation of that version of the plug-in can support PHP 7 normal running in Windows.

Related Article

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: 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.