升级WampServer支持PHP7

1. 把升级包解压后覆盖原文件 (http://aviatechno.net/files/wamp2.5.18_oto.zip)

2. 修改 wamp\wampmanager.conf 文件:

a. 在 defaultLanguage = english 后面添加

[options]
urlAddLocalhost = "off"
ChangeServicesNames = "off"
MenuItemOnline = "off"
HomepageAtStartup = "off"
ProjectSubMenu = "off"
VirtualHostSubMenu = "on"


b. 在 apacheServiceRemoveParams = "-n wampapache64 -k uninstall" 后面添加

[apacheoptions]
apachePortUsed = "80"
apacheUseOtherPort = "off"

c. 在 mysqlServiceRemoveParams = "--remove wampmysqld64" 后面添加

[mysqloptions]
mysqlPortUsed = "3306"
mysqlUseOtherPort = "off"


3. 重启Wamp即已经升级到2.5.18版了,此时已经支持PHP7了

4. 到 PHP官网 下载最新的PHP7 for Windows 的 Thread Safe 的zip包,解压到 wamp\bin\php 目录下

5. 复制php.ini-development并重命名为phpForApache.ini,修改该配置以符合您的要求

6. 从其他PHP版本目录拷贝wampserver.conf到PHP7目录下并修改成以下样子(或者用以下内容创建一个wampserver.conf文件):

<?php$phpConf['phpIniDir'] = '.';
$phpConf['phpExeDir'] = '.';
$phpConf['phpConfFile'] = 'php.ini';

//$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'] = 'php7_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php7apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] =  '';

?>


7. 重启Wamp或者刷新Wamp(如下图1,在Wamp图标上点右键选择“Refresh”)即切换到PHP7版本(如下图2)


你可能感兴趣的:(PHP,wampserver,php7)