Windows Server Installation configuration PHP7.0 Environment Graphics tutorial

Source: Internet
Author: User
Tags php website phpinfo vc9


Excerpt from Http://www.111cn.net/phper/linux-php/109865.htmWindows Server installation configuration PHP7.0 Tutorial Www.111cn.net update: 2016-05-20 Editor: Swteen Source: PHP7 installed in the Windows environment is not like the lower version of PHP, it needs to install some other plug-ins to run normally, let's take a look at the Windows Server installation configuration PHP7.0 Environment Graphics tutorial, I hope to help you.


Download and configure the Windows environment php7.0,2015 September to download 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 development of the version, in the production environment to be aware of the use of the stable version is PHP5.6.13.



Confirm the Microsoft Visual C + + version



The version of Microsoft Visual C + + is critical, unlike PHP, which is downloaded according to the Microsoft Visual C + + version.



The following comments are in the left sidebar of the PHP website.



VC9, VC11 & VC14
More recent versions of PHP is built with VC9, VC11 or VC14 (Visual Studio, or compiler respectively) and Include improvements in performance and stability.
, Haven VC9 builds require you to the Visual C + + redistributable for visual Studio, SP1 x86 or x64 installed
, Haven VC11 builds require to having the Visual C + + redistributable for Visual Studio x86 or x64 installed
, Haven VC14 builds require to having the Visual C + + redistributable for Visual Studio x86 or x64 installed
Select the PHP version that you downloaded according to the Microsoft Visual C + + version.



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



Click "Start"->"Control Panel">->"Uninstall program" To view the current version of Microsoft Visual C + +.





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


Download PHP7.0



Download it from the following PHP website.


    • http://www.php.net/


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





Download the source code to access the following URL.
    • http://windows.php.net/qa/


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



It is important to have the following precautions in the left sidebar.


Iis
If you is using PHP as FastCGI with IIS you should use the Non-thread Safe (NTS) versions of PHP. Apache
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 is the using PHP as module with Apache builds from apache.org (not rec ommended) need to use the older VC6 versions of PHP compiled with the legacy Visual Studio 6 compiler. vc9+ versions of PHP with the apache.org binaries. With Apache versions of PHP. This is the use of PHP in an Apache Web server environment. Apache can download the Apache Lounge (specific download method refer to download Apache2.4.16, installation method reference installation Apache2.4.16). PHP has "non Thread safe", "thread safe" version, where the "thread safe" version is used.


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






Click "Save" to download to any directory, complete the download steps of PHP.






Installing PHP7.0



Then proceed to the installation steps of PHP. After extracting the downloaded files, store them in any directory and complete the installation. Install to "c:\middleware\php" this time.






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



1) Add PHP module



First confirm the path of the PHP module.





In the "httpd.conf" file, look for the section "dynamic Shared Object (DSO) support". The default is around 61 rows. and append the following line at the end. LoadModule Php7_module C:/middleware/php/php7apache2_4.dll
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule‘ lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l‘) do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
???
???
#LoadModule xml2enc_module modules/mod_xml2enc.so LoadModule php7_module C:/MiddleWare/PHP/php7apache2_4.dll
After the above configuration is added, the PHP module will be read when Apache boots.


2) Login Extension



Associate the PHP extension (. php) with PHP. For example, when accessing "http://www.example.com/sample.php", the content returned to the browser is not sample.php, but rather the result of the execution of the PHP script written by sample.php.


Search for "addtype" in the "httpd.conf" file. The default is around 404 rows, and the following 2 rows are 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 to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information 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
    # probably 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 ???
???
</IfModule>
After appending the above 2 lines, the PHP program will process when the extension. php file is accessed.


3) Specify the php.ini configuration file path (phpinidir)



First confirm 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 under Phpinidir directory.


4) Confirm PHP operation



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


Open the text editor and append the following. <?php
Phpinfo ();
?>


The quiet name is "phpinfo.php", saved to Apache's Htdocs directory.






Open the browser input "http://localhost/phpinfo.php". If the following page shows PHP-related information, Apache can call PHP normally.







All right, here's the Windows Server installation configuration PHP7.0 Environment Graphics tutorial, here is the installation of that version of the plugin can support PHP 7 to run normally in Windows.



Windows Server Installation configuration PHP7.0 Environment Graphics tutorial


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