一、查看apache、php版本。
1、进入windows server 2012的windows powershell中,进入到httpd.exe所在目录,运行.\httpd -v。
显示
Server version: Apache/2.4.51 (win64)
Server built: Oct 8 2021 16:25:51
2、继续在windows powershell中,进入到php所在目录,运行.\php -v。
显示
PHP 8.0.9 (cli)(built: Jul 29 2021 14:12:19) (ZTS Visual c++ 2019 x64)Copyright (c) The PHP Group Zend Engine v4.0.9,copyright (c) zend Technologies
二、下载最新版本
1、Apache2.4.54 OpenSSL 1.1.1 VS17 x64
下载地址:https://httpd.apache.org或https://apachehaus.com/cgi-bin/download.plx
2、PHP 8.1.7-win32-vs16-x64 (vs16 x64 Thread Safe)
下载地址:https://windows.php.net/download#php-8.1
三、安装最新版本
1、安装Apache2.4.54
先停止httpd服务,运行.\httpd -k stop
除了保留原配置文件夹conf里面的所有文件外,其他的都用最新的文件替换更新。
启动httpd服务,运行.\httpd -k start
即安装更新完毕。
2、安装Php8.1.7
按上面的步骤先停止httpd服务,运行.\httpd -k st