原来的wampserver安装的是3.2.6版本,从SourceForge下载了3.3.1版本的升级包升级后,只是wampserver的版本号变了,但是php的版本并没有升级,最高版本还是8.1.0版本。因为安装drupal后,总是提示版本低,因此手工安装了php8.2.3版本。安装方式记录如下。
1、 下载php最新版本
从php.net下载最新的版本(选择线程安全的版本),然后解压到/wamp64/bin/php的目录下,重命名文件夹为php8.x.x,此处我按照我安装的最新版本8.2.3举例说明;
2、 修改配置文件
1) 复制原来PHP8.1.0版本下的wampserver.conf和phpForApache.ini文件到php8.2.3目录下;
2) 复制phpForApache.ini文件,并重命名为php.ini;
3) 修改/wamp64/wampmanager.ini文件,修改内容如下:
增加PHP8.2.3
[phpVersion]
Type: item; Caption: "5.6.40"; Action: multi; Actions:switchPhp5.6.40
Type: item; Caption: "7.4.26"; Action: multi; Actions:switchPhp7.4.26
Type: item; Caption: "8.0.13"; Action: multi; Actions:switchPhp8.0.13
Type: item; Caption: "8.1.0"; Action: multi; Actions:switchPhp8.1.0
Type: item; Caption: "8.2.3"; Action: multi; Actions:switchPhp8.2.3; Glyph: 13
Type: submenu; Caption: " "; Submenu: AddingVersions; Glyph: 1
FCGICLI增加PHP8.2.3
[phpiniFCGICLI]
Type: separator; Caption: "php.ini [FCGI - CLI]"
Type: item; Caption: "php.ini PHP 5.6.40 [FCGI - CLI]"; Glyph: 33; Action: run; FileName: "D:/Programs/Notepad++/notepad++.exe"; parameters: "D:/Programs/wamp64/bin/php/php5.6.40/php.ini"
Type: item; Caption: "php.ini PHP 7.4.26 [FCGI - CLI]"; Glyph: 33; Action: run; FileName: "D:/Programs/Notepad++/notepad++.exe"; parameters: "D:/Programs/wamp64/bin/php/php7.4.26/php.ini"
Type: item; Caption: "php.ini PHP 8.0.13 [FCGI - CLI]"; Glyph: 33; Action: run; FileName: "D:/Programs/Notepad++/notepad++.exe"; parameters: "D:/Programs/wamp64/bin/php/php8.0.13/php.ini"
Type: item; Caption: "php.ini PHP 8.1.0 [FCGI - CLI]"; Glyph: 33; Action: run; FileName: "D:/Programs/Notepad++/notepad++.exe"; parameters: "D:/Programs/wamp64/bin/php/php8.1.0/php.ini"
Type: item; Caption: "php.ini PHP 8.2.3 [FCGI - CLI]"; Glyph: 33; Action: run; FileName: "D:/Programs/Notepad++/notepad++.exe"; parameters: "D:/Programs/wamp64/bin/php/php8.2.3/php.ini"
增加PHP8.2.3说明
[switchPhp8.2.3]
Action: run; FileName: "D:/Programs/wamp64/bin/php/php5.6.40/php-win.exe";Parameters: "switchPhpVersion.php 8.2.3";WorkingDir: "D:/Programs/wamp64/scripts"; Flags: waituntilterminated
Action: multi; Actions: apache_stop_start_refresh; Flags:appendsection
3、 重启所有服务,PHP版本就可以看到PHP8.2.3版本了