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"
<directory "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
<virtualhost *:8080>
ServerName www.mysite1.com
#DocumentRoot "C:/rainman/projectworkspace2.0/sourcecode/server/wanpush"
DocumentRoot "C:/rainman/projectworkspace3.0_clound/sourcecode"
<directory "C:/rainman/projectworkspace3.0_clound/sourcecode" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
Errorlog "Logs/mysite1.com-error.log"
Customlog "Logs/mysite1.com-access.log" common
</VirtualHost>
Namevirtualhost *:8081
<virtualhost *:8081>
ServerName www.mysite2.com
DocumentRoot "C:/rainman/projectworkspace3.0_clound/yiqixiu"
<directory "C:/rainman/projectworkspace3.0_clound/yiqixiu" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
Errorlog "Logs/mysite2.com-error.log"
Customlog "Logs/mysite2.com-access.log" common
</VirtualHost>
The DocumentRoot and directory parameters are configured primarily for each virtual site.
Verify
After the installation is complete, write the following HTML page:
<body>
</body>
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 installation
Download the Php-7.0.6-win32-vc14-x64.zip and unzip it to any directory.
Configuration
1. Configure Apache
Open the Apache configuration file and add the following:
LoadModule php7_module " d:/phpdevenv/Php/php7apache2_4.dll"
AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
AddHandler application/x-httpd-php. php
Phpinidir " 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
Create a phpinfo.php file in the root directory of the Apache Web site (see section 2.1 for specific locations):
<?php
Phpinfo ();
?>
Open http://localhost:8080/phpinfo.php in the browser.
This article is from the "Rainman" blog, make sure to keep this source http://lancelot.blog.51cto.com/393579/1772929
PHP 7 Installation configuration (WIN10)