Home  >  Article  >  Backend Development  >  How to add php7 and apache to wamp

How to add php7 and apache to wamp

醉折花枝作酒筹
醉折花枝作酒筹forward
2021-08-12 09:19:012033browse

A group of open source software commonly used to build dynamic websites or servers. They are all independent programs. However, because they are often used together, they have increasingly higher compatibility, and together they form a powerful Web. Application platform.

How to add php7 and apache to wamp

Recently, I added php7.0.5 to the php in my wamp, and also added a higher version of apache. I will record and share it here.

1. Instructions before configuration

  • My computer is win10, and the wamp used is wamp2.5 64-bit version. You can download the latest official version here http://www.wampserver.com/en/ (While writing this blog, I suddenly discovered that wamp3.0 has been released (dizzy~~~), which has php7 pre-installed. )

  • Take installing php7.0.5 and installing apache4.17 as an example. The installation of other versions is the same

  • Please go to the official website to download the PHP version you want to install: http://windows.php.net/download

  • You will find that you don’t know which php version to choose. Is it non thread safe or thread safe? When using wamp in windows, it is recommended to use thread safe. I will write a blog about their differences later. (In fact, there are instructions on the left side of the download page, but they are in English~~~)

2. wamp2.5 installs php7

in this directory: wamp/bin Create a new folder in /php and name it the corresponding php version number (the folder I created is php7.0.5)

Extract the downloaded php compressed package to this folder Next

Enter the php7.0.5 directory, copy a copy of php.ini-development for php.ini

Configure php.ini

Copy a copy from php.ini and name it phpForApache.ini

Copy wampserver.conf from the phpx.x.x folder that already exists by default to the newly added php folder (mine is php7.0.5), and open it for editing

$phpConf'apache'['LoadModuleName'] = 'php5_module';
$phpConf'apache'['LoadModuleFile'] = 'php5apache2_4.dll';
改为:
$phpConf'apache'['LoadModuleName'] = 'php7_module';
$phpConf'apache'['LoadModuleFile'] = 'php7apache2_4.dll';

If the added php version is not php7 but php5, the file usually does not need to be modified.

Exit wampserver and restart

Select the corresponding php version, create a new file and write phpinfo() function; and run. Check to see if the corresponding version is successfully enabled.

How to add php7 and apache to wamp

How to add php7 and apache to wamp

3. Add apache to wamp2.5

Create a new one in this directory: wamp/bin/apache The name of the folder is the corresponding apache version number (mine is 2.4.17)

Extract the downloaded apache compressed package to this folder

Enter the default apache directory (my wamp2.5 defaults to apache2.4.9), and then copy the wampserver.conf file to the new apache directory just created

Exit wampserver and restart

How to add php7 and apache to wamp

4. Note

After you complete the installation, if you directly open and modify the corresponding php.ini or httpd.conf and then restart the service, it will not take effect. I don’t know why. For wamp, you need to open the corresponding configuration file through wamp and modify it. This is very important. Only the modification of the configuration file opened in wamp is useful. It took me a long time to do this.

How to add php7 and apache to wamp

Recommended learning: php video tutorial

The above is the detailed content of How to add php7 and apache to wamp. For more information, please follow other related articles on the PHP Chinese website!

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