PHP 加载错误:%1 不是有效的 Win32 应用程序。

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31714946/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:34:56  来源:igfitidea点击:

PHP load error: %1 is not a valid Win32 application.

phpapache

提问by Ethernetz

Running a win64 architecture, attempting to run php with Apache for the first time. After loading the php module in the httpd.conf, apache fails to start and the error log displays

运行win64架构,第一次尝试用Apache运行php。在httpd.conf中加载php模块后,apache启动失败并显示错误日志

Cannot load c:/php/php5apache2_4.dll into server: %1 is not a valid Win32 application.  

Other sources claim this is a compatbility issue, and that there is either a win32 version of php with win64 apache, or vice versa, I do not think this is the case. I downoaded the win64 vc14 version of apache from http://www.apachelounge.com/download/and the win64 vc11 version of php from http://windows.php.net/download#php-5.6- What is causing the error when I attempt to load the php module?

其他消息来源声称这是一个兼容性问题,并且存在带有 win64 apache 的 win32 版本的 php,反之亦然,我不认为是这种情况。我downoaded从Apache的Win64中VCl 4版http://www.apachelounge.com/download/并从PHP的Win64的VC11版本http://windows.php.net/download#php-5.6-是什么原因造成的错误当我尝试加载 php 模块时?

采纳答案by Alpesh Panchal

It is actually binary version difference so compatibility issue between apache and php.

这实际上是二进制版本的差异,所以 apache 和 php 之间的兼容性问题。

Since you've installed apache vc14 windows 64, download this php of vc14

由于您已经安装了 apache vc14 windows 64,请下载 vc14 的这个 php

http://windows.php.net/downloads/releases/php-7.0.13-Win32-VC14-x86.zipto config php with apache.

http://windows.php.net/downloads/releases/php-7.0.13-Win32-VC14-x86.zip使用 apache 配置 php。