天天看點

為wampserver 添加新版本php支援

1.1.  停止WAMP伺服器.

2.下載下傳要安裝的PHP版本。下載下傳Window版本的ZIP包啦:http://windows.php.net。解壓到 Wamp的安裝目錄\bin\php\php7.2.3。

3.從已存在的php版本檔案中(如php7.0.4 (eg.   wamp/bin/php/php7.0.4)複制以下檔案: -  php.ini、phpForApache.ini和wampserver.conf到php7.2.3檔案夾.

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:switchPhpphp7.2.3 [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.phpphp7.2.3";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.選擇phpphp7.2.3版本,選擇後後會重新開機wamp。

9.可以打開phpinfo察看此時是否有phpphp7.2.3的資訊,然後打開Phpmyadmin,看是否可以通路。

10.完成。

轉載于:https://www.cnblogs.com/bryantzx/p/8578619.html

php