1.下载需要的PHP版本

下载地址:

https://windows.php.net/download#php-7.0

下载说明:

根据系统选择版本

64位选 VC14 x64 Thread Safe

32位选 VC14 x86 Thread Safe

当前笔者下载版本:php-7.1.23-Win32-VC14-x64.zip

wampserver php升级步骤_wampserver php升级步骤

2.下载VC14

下载地址:https://www.microsoft.com/en-US/download/details.aspx?id=48145

wampserver php升级步骤_wampserver php升级步骤_02

wampserver php升级步骤_wampserver php升级步骤_03

下载完成后,双击进行安装

wampserver php升级步骤_wampserver php升级步骤_04

3.在wamp/bin/php下创建文件夹

文件夹名称:php7.1.23

wampserver php升级步骤_wampserver php升级步骤_05

将下载的php-7.1.23-Win32-VC14-x64.zip解压后放到上面创建的文件中

wampserver php升级步骤_wampserver php升级步骤_06

复制php.ini-development重命名为php.ini

wampserver php升级步骤_wampserver php升级步骤_07

编辑php.ini文件,查找;extension_dir = "ext/"关键词,修改为extension_dir = "E:\wamp\bin\php\php7.1.23\ext"

wampserver php升级步骤_wampserver php升级步骤_08

复制php.ini文件,重命名为phpForApache.ini

wampserver php升级步骤_wampserver php升级步骤_09

4.将wamp/bin/php下原版本wampserver.conf复制到新版本的 php7.x.x文件夹下

wampserver php升级步骤_wampserver php升级步骤_10

wampserver php升级步骤_wampserver php升级步骤_11

5.编辑php7.x.x文件夹下的wampserver.conf文件

原内容:

$phpConf['apache']['2.2']['LoadModuleName'] = 'php5_module';

$phpConf['apache']['2.2']['LoadModuleFile'] = 'php5apache2_2.dll';

$phpConf['apache']['2.2']['AddModule'] =  '';


$phpConf['apache']['2.4']['LoadModuleName'] = 'php5_module';

$phpConf['apache']['2.4']['LoadModuleFile'] = 'php5apache2_4.dll';

$phpConf['apache']['2.4']['AddModule'] =  '';

wampserver php升级步骤_wampserver php升级步骤_12


修改后内容:

$phpConf['apache']['2.2']['LoadModuleName'] = 'php7_module';

$phpConf['apache']['2.2']['LoadModuleFile'] = 'php7apache2_2.dll';

$phpConf['apache']['2.2']['AddModule'] =  '';


$phpConf['apache']['2.4']['LoadModuleName'] = 'php7_module';

$phpConf['apache']['2.4']['LoadModuleFile'] = 'php7apache2_4.dll';

$phpConf['apache']['2.4']['AddModule'] =  '';

wampserver php升级步骤_wampserver php升级步骤_13

6.重新启动wampserver服务,启动后可以选择相应的php版本

wampserver php升级步骤_wampserver php升级步骤_14

7.在浏览器查看当前的php使用版本

var_dump(phpinfo());

wampserver php升级步骤_wampserver php升级步骤_15

wampserver php升级步骤_wampserver php升级步骤_16