如何再wamp 下安装多个版本的php
2个回答
推荐于2018-03-29 · 知道合伙人互联网行家
关注
展开全部
只需以下步骤:
1、下载要安装的PHP版本。既然是用WampServer,那当然是下载Window版本的ZIP包啦:http://windows.php.net。解压到
Wamp的安装目录\bin\php\php5.2.17。这里以5.2.17为例。
2、进入 Wamp的安装目录\bin\php\php5.2.17 目录,从 php.ini-dist 或者 php.ini-recommended 复制一份,重命名为php.ini,适应修改php.ini配置(如extension_dir),再从php.ini复制一分,重命名为 phpForApache.ini。
3、从已有的版本目录中复制一份 wampserver.conf。比如我安装WampServer的时候已经有php5.3.0,在 Wamp的安装目录\bin\php\php5.3.0 目录下复制 wampserver.conf
到 Wamp的安装目录\bin\php\php5.2.17。
4、修改Wamp配置文件:进入 Wamp的安装目录,用IDE或记事本(最好使用行号定位的记事本,如EditPlus等)打开 wampmanager.ini,定位到 335 行,通常在这一行就是[phpVersion],如果不是,则在附近找找。复制下面一行:
Type: item; Caption: "5.3.0"; Action: multi; Actions:switchPhp5.3.0
插入到这一行前面,并修改为
Type: item; Caption: "5.2.17"; Action: multi; Actions:switchPhp5.2.17
再复制
[switchPhp5.3.0]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php 5.3.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;
插入这一段之前,并修改为
[switchPhp5.2.17]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php 5.2.17";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;
5、退出WampServer,再重启。完成。
通过这5步,即可完成PHP任意版本的安装。
1、下载要安装的PHP版本。既然是用WampServer,那当然是下载Window版本的ZIP包啦:http://windows.php.net。解压到
Wamp的安装目录\bin\php\php5.2.17。这里以5.2.17为例。
2、进入 Wamp的安装目录\bin\php\php5.2.17 目录,从 php.ini-dist 或者 php.ini-recommended 复制一份,重命名为php.ini,适应修改php.ini配置(如extension_dir),再从php.ini复制一分,重命名为 phpForApache.ini。
3、从已有的版本目录中复制一份 wampserver.conf。比如我安装WampServer的时候已经有php5.3.0,在 Wamp的安装目录\bin\php\php5.3.0 目录下复制 wampserver.conf
到 Wamp的安装目录\bin\php\php5.2.17。
4、修改Wamp配置文件:进入 Wamp的安装目录,用IDE或记事本(最好使用行号定位的记事本,如EditPlus等)打开 wampmanager.ini,定位到 335 行,通常在这一行就是[phpVersion],如果不是,则在附近找找。复制下面一行:
Type: item; Caption: "5.3.0"; Action: multi; Actions:switchPhp5.3.0
插入到这一行前面,并修改为
Type: item; Caption: "5.2.17"; Action: multi; Actions:switchPhp5.2.17
再复制
[switchPhp5.3.0]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php 5.3.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;
插入这一段之前,并修改为
[switchPhp5.2.17]
Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "Wamp的安装目录/bin/php/php5.3.0/php-win.exe";Parameters: "switchPhpVersion.php 5.2.17";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;
5、退出WampServer,再重启。完成。
通过这5步,即可完成PHP任意版本的安装。
2014-11-03
展开全部
这个真没听过可以装多个版本的
要是版本低了的话,可以升级啊
PHP5.X以上的话,兼容还是不错的
要是版本低了的话,可以升级啊
PHP5.X以上的话,兼容还是不错的
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询