WAMP 服务器在全新安装时切换 Apache/PHP 版本时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18704910/
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
WAMP Server errors switching Apache / PHP versions on fresh install
提问by davestewart
A fresh download and install of WAMP Server works successfully (Apache 2.4.4 PHP 5.4.12).
WAMP 服务器的全新下载和安装成功运行(Apache 2.4.4 PHP 5.4.12)。
However as soon as I install a different version of Apache, in this case 2.4 to 2.0 (so I can run PHP 5.2 & 5.4), WAMP goes offline with an orange icon.
但是,一旦我安装了不同版本的 Apache,在本例中为 2.4 到 2.0(因此我可以运行 PHP 5.2 和 5.4),WAMP 将脱机并显示橙色图标。
If I try to switch BACK to the original Apache version I get this show-stopping error:
如果我尝试切换回原始 Apache 版本,则会出现此显示停止错误:
Sorry,
This Apache version doesn't seem to be compatible with your actual PHP Version.
Switch cancelled.
Press ENTER to continue...
This doesn't make any sense, as this is a fresh install so both the Apache + PHP versions are the defaults.
这没有任何意义,因为这是全新安装,因此 Apache + PHP 版本都是默认值。
Here's what the UI is telling me:
这是用户界面告诉我的:
- The WAMP icon is now orange
- the Apache/Version/2.4.4 icon has a red warning icon next to it
the Apache/Version/2.0.63 icon has a tick next to it
- WAMP 图标现在为橙色
- Apache/Version/2.4.4 图标旁边有一个红色警告图标
Apache/Version/2.0.63 图标旁边有一个勾号
I've tried installing other versions of Apache too, but the issue seems to be with the base 2.4 WAMP installed options.
我也尝试安装其他版本的 Apache,但问题似乎出在基本 2.4 WAMP 安装选项上。
Extra info: port 80 is free, and I used to use WS 2.0e all the time without these kinds of issues.
额外信息:端口 80 是免费的,我曾经一直使用 WS 2.0e,没有这些问题。
Thanks, Dave
谢谢,戴夫
回答by Mahmut Duman
Go To \wamp\bin\php\phpX.Y.Z\wampmanager.conf.
去 \wamp\bin\php\phpX.Y.Z\wampmanager.conf.
Edit wampmanager.conf via Notepad++
通过 Notepad++ 编辑 wampmanager.conf
Add This Codes.. And Save wampmanager.conf
添加此代码..并保存 wampmanager.conf
$phpConf['apache']['2.4']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php5apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] = '';
Restart Wamp Manager..
重新启动 Wamp 管理器..
回答by ofzza
just had a similar problem - was upgrading WAMP from Apache 2.2 / PHP 5.3 to Apache 2.4 / PHP 5.4
刚刚遇到了类似的问题 - 正在将 WAMP 从 Apache 2.2 / PHP 5.3 升级到 Apache 2.4 / PHP 5.4
This is what worked for me:
这对我有用:
- Stop apache service
- Remove the unwanted version's apache service using WAMP manager's 'Remove service' option. (check in Windows services if really removed)
- Manually edit the 'wampmanager.conf' in the WAMP's installation directory to use Apache and PHP versions you want to use (sections: 'php', 'phpCli' and 'apache' / properties 'xVersion' and 'xLastKnown')
- Shutdown WAMP manager
- (Re)Start WAMP manager
- (Re)Install the wanted version's apache service using WAMP manager's 'Install service' option. (check in Windows services if really installed)
- (Re)Start apache service
- 停止apache服务
- 使用 WAMP 管理器的“删除服务”选项删除不需要的版本的 apache 服务。(如果真的删除,请检查Windows服务)
- 手动编辑 WAMP 安装目录中的“wampmanager.conf”以使用您要使用的 Apache 和 PHP 版本(部分:“php”、“phpCli”和“apache”/属性“xVersion”和“xLastKnown”)
- 关闭 WAMP 管理器
- (重新)启动 WAMP 管理器
- (重新)使用 WAMP 管理器的“安装服务”选项安装所需版本的 apache 服务。(如果真的安装,请检查Windows服务)
- (重新)启动apache服务
NOTE: Always run WAMP manager as admin
注意:始终以管理员身份运行 WAMP 管理器
... After this phpinfo() shows new Apache and PHP versions and seems to work fine. Hope it helps.
...在此 phpinfo() 显示新的 Apache 和 PHP 版本之后,似乎工作正常。希望能帮助到你。
回答by borayeris
The problem is WAMP version 2.4. I don't know why but v2.4 is not compatible with addons. Then I tried 2.2E. It was fine with addons.
问题是 WAMP 2.4 版。我不知道为什么 v2.4 与插件不兼容。然后我尝试了2.2E。有插件就好了。
By the way, addons compiled for 32bit. So do not install 64bit Wamp if you think that you would use addons.
顺便说一句,插件编译为 32 位。因此,如果您认为会使用插件,请不要安装 64 位 Wamp。
回答by Ankit Sharma
When updating WAMP from 2.2
to 2.4
or switching from Apache 2.2.22/PHP 5.3.13
to Apache 2.4.4/PHP 5.4.12
, WAMP installs new service as Apache/2.4.4 (Win64) PHP/5.3.13
to make it use PHP 5.4.12
更新 WAMP 从2.2
到2.4
或从 切换Apache 2.2.22/PHP 5.3.13
到 时Apache 2.4.4/PHP 5.4.12
,WAMP 会安装新服务Apache/2.4.4 (Win64) PHP/5.3.13
以使其使用PHP 5.4.12
1) Uninstall apache service
2) Modify
1)卸载apache服务
2)修改
C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf
Change line
换线
LoadModule php5_module "c:/wamp/bin/php/php5.3.13/php5apache2_4.dll"
to
到
LoadModule php5_module "c:/wamp/bin/php/php5.4.12/php5apache2_4.dll"
3) (Re)Start WAMP
4) Install Apache Service
5) Restart all services
3)(重新)启动 WAMP
4)安装 Apache 服务
5)重启所有服务
Verify the service description of service wampapache
in windows service manager to match Apache/2.4.4 (Win64) PHP/5.4.12
验证wampapache
windows服务管理器中服务的服务描述是否匹配Apache/2.4.4 (Win64) PHP/5.4.12
回答by Syntax Error
I had this same issue - what I finally did was follow ofzza's and Ankit Sharma's tips, as well as manually removing the directory of the older php version while the services were stopped.
我遇到了同样的问题 - 我最终做的是遵循 ofzza 和 Ankit Sharma 的提示,以及在服务停止时手动删除旧 php 版本的目录。
It seems to have worked, except when I call phpinfo() the top heading still claims it's the older version of php even though it's definitely running the newer one. Very strange, but everything is working so I'm fine with it.
它似乎有效,除了当我调用 phpinfo() 时,顶部标题仍然声称它是旧版本的 php,即使它肯定运行的是较新版本。很奇怪,但一切正常,所以我很好。
回答by kakoma
The previous installation could be part of the problem. Install WAMP 2.4in a new directory (It comes bundled with the Apache version you want) & then migrate your www folder. Directly upgrading has not been error-free for me.
以前的安装可能是问题的一部分。在新目录中安装WAMP 2.4(它与您想要的 Apache 版本捆绑在一起)然后迁移您的 www 文件夹。直接升级对我来说并不是没有错误。
Alternatively, back-up your current version [Databases, config files & www dir], uninstall it and install the new version. Restore your information after
或者,备份您当前的版本 [数据库、配置文件和 www 目录],将其卸载并安装新版本。之后恢复您的信息