时间:2021-07-01 10:21:17 帮助过:3人阅读
1.1. 停止WAMP服务器.
2.下载要安装的PHP版本。下载Window版本的ZIP包啦:http://windows.php.com。解压到 Wamp的安装目录\bin\php\php7.1.0。 --- 注意自己是vc11还是vc14 vc 9
3.从已存在的php版本文件中(如php7.0.4 (eg. wamp/bin/php/php7.0.4)复制以下文件: - php.ini、phpForApache.ini和wampserver.conf到php7.1.0文件夹.
4.打开php7.1.0文件夹的以下文件: - php.ini和phpForApache.ini并且把其中所有的 7.0.4替换为7.1.0。
5.修改Wamp配置文件:进入 Wamp的安装目录,用IDE或记事本(最好使用行号定位的记事本,如EditPlus等)打开 wampmanager.ini,定位到 335 行,通常在这一行就是[phpVersion],如果不是,则在附近找找。复制下面一行:
Type: item; Caption: "5.6.19"; Action: multi; Actions:switchPhp7.0.4
插入到这一行前面,并修改为
Type: item; Caption: "5.6.19"; Action: multi; Actions:switchPhp7.1.0
[switchPhp5.3.0]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.6.19/php-win.exe";Parameters: "switchPhpVersion.php 5.3.0";WorkingDir: "Wamp的安装目录/scripts"; Flags: waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.6.19/php-win.exe";Parameters: "-c . refresh.php";WorkingDir: "Wamp的安装目录/scripts"; Flags: waituntilterminated
Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated
Action: resetservices
Action: readconfig;
插入这一段之前,并修改为
[switchPhp7.1.0]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php7.1.0";WorkingDir: "Wamp的安装目录/scripts"; Flags: waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.3.0/php-win.exe";Parameters: "-c . refresh.php";WorkingDir: "Wamp的安装目录/scripts"; Flags: waituntilterminated
Action: run; FileName: "net"; Parameters: "start wampapache"; ShowCmd: hidden; Flags: waituntilterminated
Action: resetservices
Action: readconfig;
6. 去wamp/bin/apache/apache/apache2.2.11/bin删除php.ini文件。
7..重启wamp.
8.选择php7.1.0版本,选择后后会重启wamp。
9.可以打开phpinfo察看此时是否有php7.1.0的信息,然后打开Phpmyadmin,看是否可以访问。
10.完成。
(注意:php7.1.0不支持mysql-connect()连接mysql数据库)
相关推荐:
nginx添加php basic验证
以上就是WAMP 添加php新版本 的详细内容,更多请关注Gxl网其它相关文章!