windows php5.3升级,Windows8.1 64位下升级PHP-5.3.5至PHP-5.4.42的详细流程!

1、由于准备使用Yii 2.0框架,其需要 PHP 5.4 或更高版本,因此决定升级PHP版本;

2、现在环境为:Windows8.1 64、Apache 2.2.25(http://www.apache.org/)、MySQL-5.5.28、PHP-5.3.5、phpMyAdmin-4.2.9.1;

969be9c773131b7db840f3af1e7fefd4.png

升级前环境截图

3、准备升级为:Windows8.1 64、Apache 2.4.12(http://www.apachelounge.com/)、MySQL-5.5.28、PHP-5.4.42、phpMyAdmin-4.2.9.1,主要是将PHP升级为5.4.42,Apache从VC6编辑的转换为VC9编译的,且升级为2.4.12;

4、打开网址:http://windows.php.net/download/#php-5.4-ts-VC9-x86 ,下载php-5.4.42-Win32-VC9-x86.zip;

5、阅读左侧提示文档:

Which version do I choose?

IIS

If you are using PHP as FastCGI with IIS you should use the Non-Thread Safe (NTS) versions of PHP.

Apache

Please use the Apache builds provided by Apache Lounge. They provide VC9, VC11 and VC14 builds of Apache for x86 and x64. We use their binaries to build the Apache SAPIs.

If you are using PHP as module with Apache builds from apache.org (not recommended) you need to use the older VC6 versions of PHP compiled with the legacy Visual Studio 6 compiler. Do NOT use VC9+ versions of PHP with the apache.org binaries.

With Apache you have to use the Thread Safe (TS) versions of PHP.

VC9, VC11 & VC14

More recent versions of PHP are built with VC9, VC11 or VC14 (Visual Studio 2008, 2012 or 2015 compiler respectively) and include improvements in performance and stability.

– The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed

– The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed

– The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed

其大概意思翻译为:

我该选择哪个版本?

IIS

如果您使用的是PHP作为FastCGI的使用IIS,你应该使用非线程安全(NTS)版本的PHP。

阿帕奇

请使用由Apache Lounge提供的Apache。它们提供VC9,VC11和VC14建立的Apache,可用于x86和x64。我们用自己的二进制代码来构建Apache的SAPIs。

如果您使用的是PHP与Apache模块构建从apache.org(不推荐),你需要使用PHP的较老版本VC6与传统的Visual Studio 6编译器编译。不要使用VC9 +版本的PHP与apache.org二进制文件。

注:Windows版本的Apache1和Apache2使用VC6编译,因此要想在Windows下使用官方Apache+PHP,就必须要使用VC6版本,以兼容官方的Apache,而不能使用VC9版本编译的PHP,因为之间存在不兼容。现在PHP 5.4以上版本不提供VC6的,有两种方案,1:编译出一个5.4的VC6版本(因为过老,PHP官方已经放弃,不推荐),2:让Apache编译出一个VC9的版本,其本质上就是让Apache兼容PHP,Apache Lounge就提供了VC9以上的版本;

6、如果只是升级PHP至5.4.42,发现也是可以使用的,截图如下:

d4abdf5449c3233a24c39c581aa61819.png

暂时只升级PHP版本,Apache仍然为官方软件;

根据PHP官方的提示,虽然运行PHP程序没有问题,但是理论上来说还是存在兼容性问题的,因此决定升级Apache为VC9版本;

7、卸载Apache 2.2.25(http://www.apache.org/) 截图如下:

04f950fb4c1293ab15c696714d529138.png

卸载Apache 2.2.25(http://www.apache.org/)

8、安装Apache 2.4.12(http://www.apachelounge.com/),具体下载地址为:http://www.apachelounge.com/download/additional/:

复制D:\软件\httpd-2.4.12-win32-VC9\Apache24至C:\Apache24

9、在DOS窗口启动Apache:

7ae1cf00ebeccb1fcef3acca5b47bdcd.png

在DOS窗口启动Apache

10、解决AH00112错误流程如下:

a595e7145c1454f50cb6249ccb230d86.png

11、解决AH00112错误成功;

eedb2936a4e342df99948d101e45a821.png

解决AH00112错误成功

12、解决AH00558错误:

1cb47de5e7ac3ed10cdde1c4c5b71444.png

解决AH00558错误

13、解决(OS 10048),原因在于多次运行同一命令,而Apache进行已经启用的缘故,因此在调试错误之前,建议关闭相应进程;

c1bee7d76eccca4651e4b1fa88eab4e9.png

(OS 10048)的处理

1484620e4ac39bbea198b98bcaf86e14.png

结束Apache进程

14、将Apache安装为服务:

d84ce629946e67126927dcf2f89cacd7.png

将Apache安装为服务

15、报错,权限不足,应该以Administrator运行,以管理员身份运行cmd.exe(命令提示符(管理员)(A)):

1c6811feb969f92d0ab18c270ee0609e.png

命令提示符(管理员)(A),将Apache安装为服务

16、双击ApacheMonitor.exe,或把它放在你的启动文件夹中。

50cc5b2d24f30dd273299511f078c371.png

将Apache放置通知区域中

17、phpinfo运行截图

61a289dfc45d0ad28870fe36039abed1.png

phpinfo运行截图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值