Home  >  Article  >  Backend Development  >  How to install PHP7 in Wamp?

How to install PHP7 in Wamp?

PHPz
PHPzOriginal
2023-04-25 16:13:05646browse

Wamp is an integrated software that installs Apache server, MySQL database and PHP operating environment on Windows operating system. The emergence of Wamp greatly simplifies the installation and configuration of local servers, allowing developers to happily develop and test web applications on Windows systems. PHP7 is the latest version of the PHP language. Compared with previous versions, it has been greatly improved in terms of performance and security. This article will teach you how to install PHP7 in Wamp.

Step one: Download PHP7

First, you need to download the Windows version of PHP7 from the official website http://windows.php.net/download/. We can select VC14 x64 Non Thread Safe at the bottom of the download page.

After downloading, unzip PHP7 to bin/php in the Wamp installation directory. The name of the unzipped folder is arbitrary, such as "php7".

Step 2: Configure Wamp

On Wamp's tray icon, select "Apache"->"httpd.conf" to open Apache's main configuration file.

Find the following code: LoadModule php5_module "c:/wamp/bin/php/php5.6.25/php5apache2_4.dll", change "php5_module" to "php7_module", and change the file path to where PHP7 is located Path, that is:

LoadModule php7_module "c:/wamp/bin/php/php7/php7apache2_4.dll"

Then, add the following code:

AddType application/x -httpd-php .php
AddType application/x-httpd-php-source .phps

also changed to:

AddType application/x-httpd-php7 .php
AddType application/x-httpd-php7-source .phps

After saving, restart Wamp.

Step 3: Check the PHP version

In Wamp's tray icon, select "PHP"->"Version" to check whether the current PHP version is PHP7.

At this point, Wamp has successfully installed PHP7. We can create a test.php file in the www directory and write the following code:

phpinfo();

?>

After saving, in the browser Enter http://localhost/test.php to see the PHP7 information page.

Summary

Installing PHP7 is not complicated. You only need to unzip PHP7 to the specified location, modify the Apache main configuration file, and then check the PHP version. With PHP7, the development and operation of web applications will be faster and safer.

The above is the detailed content of How to install PHP7 in Wamp?. For more information, please follow other related articles on the PHP Chinese website!

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