這篇文章主要介紹了WAMP 添加php新版本 ,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下
1.1. 停止WAMP伺服器.
2.下載要安裝的PHP版本。下載Window版本的ZIP包啦:http://windows.php.net。解壓到 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資料庫)