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

php7 Installation Guide (windows) Installation and Configuration of PHP7

藏色散人
Release: 2023-02-17 12:12:01
forward
6622 people have browsed it

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
Copy after login

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     .
Copy after login

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>
Copy after login

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();
Copy after login

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!

Related labels:
source:hcoder.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template