Home  >  Article  >  Backend Development  >  php7 Installation Guide (windows) Installation and Configuration of PHP7

php7 Installation Guide (windows) Installation and Configuration of PHP7

藏色散人
藏色散人forward
2019-04-13 15:02:266574browse

Unzip the file

After downloading, you will get the php7 installation package (for example: php-7.0.0-Win32-VC14-x64.zip). (Related recommendation: "PHP7 Tutorial")

After decompression, copy the php file to the installation directory: D:\phpserver\php

php7 Installation Guide (windows) Installation and Configuration of PHP7

Modify the apache configuration file to load php 7

apache configuration file location: D:\phpserver\apache\conf\http.conf

LoadModule php7_module "D:\phpserver\php\php7apache2_4.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

php7 Installation Guide (windows) Installation and Configuration of PHP7

Restart apache after the modification is completed

The vc runtime library is not installed. PHP startup failure solution

The vc runtime library (Microsoft Visual C 2005 Redistributable Package) is not installed to start When using apache, an error will be reported (clicking D:\phpserver\php\php.exe prompts that the dll file is missing), check the error message:

The Apache service named  reported the following error:
>>> httpd.exe: Syntax error on line 181 of D:/phpserver/apache/conf/httpd.conf: 
Cannot load D:/phpserver/php/php7apache2_4.dll into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3     .

Solution to install the vc runtime library, path:

1. Use 360 ​​Software Manager to search for "Microsoft Runtime Library" and the "Microsoft Commonly Used Runtime Library Collection" will appear and install it.

2. Search "Microsoft Runtime Library Collection" on Baidu to install or search "MSVC14 (Visual C 2015)" to install.

Modify the apache configuration file and set index.php as the default homepage

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

After solving the above problems, restart apache to start apache and php. Let’s start the php7 journey^_^

Create a php file in the site directory, such as: demo.php, write the code:

<?php
phpinfo();

to start observing phpinfo!

php7 Installation Guide (windows) Installation and Configuration of PHP7

The above is the detailed content of php7 Installation Guide (windows) Installation and Configuration of PHP7. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:hcoder.net. If there is any infringement, please contact admin@php.cn delete