WIN10 Environment PHP 7 Installation Configuration "Tutorial", WIN10 installation configuration _php Tutorial

Source: Internet
Author: User
Tags configuration php phpinfo

WIN10 Environment PHP 7 Installation Configuration "Tutorial", WIN10 installation configuration


PHP 7 out for some time, the previous days work relatively busy, no time to study, now a little time, the company's production environment can not be easily upgraded, the home's own computer can also be installed to see the effect.

The following is a brief description of the installation of PHP 7 + Apache 2.4.

Apache 2.4 Installation Configuration Installation

Apache 2.4, on the official website does not have the compiled version under Windows, need to http://httpd.apache.org/docs/2.4/platform/ Windows.html found to provide a Windows compiled version of the download of the mirror site, I use: http://www.apachelounge.com/download/, as needed to download the 32 or 64-bit version, after downloading is a zip package. After downloading, unzip the Apace24 directory in the ZIP package to any directory.

Note: Some information about Apache and PHP to match, including 32/64-bit, VC version number. For PHP 7, the official web only VC14 compiled version, so the corresponding Apache version also needs to be VC14 compiled.

Configuration

Single Site Configuration

Open%apache24%\conf\httpd.conf File:

1. Find "ServerRoot" and designate it as%apache24% directory;

2, modify the document root directory;

DocumentRoot "E:/wwwpages" 
 
   
 
  

3. Add index.php to the index directory

DirectoryIndex index.html index.php

4. Install Apache as a service:

Httpd.exe-k install-n "Apache24"

Modify the lower number if the service fails to start.

Multi-site configuration (differentiated by port number)

Multiple sites can be configured on a single server, and this section describes how to configure different sites that are differentiated by port numbers.

Configure Httpd.conf.

First increase the listening port (configure several sites, add several ports):

Listen 8081

Listen 8082

When the above content is set, you can check whether the port is turned on by Netstat-n-A.

Second, configure the virtual site:


Namevirtualhost *:8080 
 
  
   
    ServerName www.mysite1.com  #DocumentRoot "c:/rainman/projectworkspace2.0/ Sourcecode/server/wanpush "DocumentRoot" C:/rainman/projectworkspace3.0_clound/sourcecode "  
  
   
    
    Options Indexes followsymlinks allowoverride None Order allow,deny  
  
    allow from all errorlog "Logs/mysite1.com-error.log "  customlog" Logs/mysite1.com-access.log "common 
 
   namevirtualhost *:8081 
 
  
   
    ServerName www.mysite2.com  documentroot "C:/rainman/projectworkspace3.0_clound/yiqixiu" 
  
   
    
    Options Indexes followsymlinks allowoverride None Order allow,deny  
  
    allow from all errorlog "logs/ Mysite2.com-error.log "  customlog" Logs/mysite2.com-access.log "Common 
 
  

The DocumentRoot and directory parameters are configured primarily for each virtual site.

Verify

After the installation is complete, write the following HTML page:

Hello world!


Save As Index.html, and the file is copied to "E:/wwwpages".
Open url:http://localhost:8080/, the page displays "Hello world!", indicating that the Apache installation started successfully.

Uninstall Service

Uninstall Service: Httpd–k uninstall–n "Apache24"

Note: The name must be consistent with the name at the time of installation.

PHP 7.0.6 installation configuration install download Php-7.0.6-win32-vc14-x64.zip, unzip it to any directory.
Configuration 1, configuring Apache
Open the Apache configuration file and add the following:

LoadModule php7_module "D:/phpdevenv/php/php7apache2_4.dll" AddType application/x-httpd-php. PhpAddType application/ x-httpd-php. Htmladdhandler application/x-httpd-php. Phpphpinidir "d:/phpdevenv/php"



Note: The red section uses the actual path.

2. Configure PHP

Rename the php.ini-development in the PHP directory to PHP.ini, then open the file, look for "extension_dir", remove the previous comment, and modify it to an absolute path, for example:
Extension_dir = "D:/phpdevenv/php/ext"

Note: Modifying to an absolute path is to prevent some PHP extensions from finding the correct path.
Verify that a phpinfo.php file is created under the Apache Web site root directory (see section 2.1 for specific locations):
<?php
Phpinfo ();
?>

Open http://localhost:8080/phpinfo.php in the browser.

http://www.bkjia.com/PHPjc/1125902.html www.bkjia.com true http://www.bkjia.com/PHPjc/1125902.html techarticle WIN10 Environment PHP 7 Installation Configuration "Tutorial", WIN10 installation configuration PHP 7 come out for a while, the previous days work relatively busy, no time to study, now a little time, the company production ring ...

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