php WAMP 服务器不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/410391/
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-24 22:39:51  来源:igfitidea点击:

WAMP Server not working

phplocalhostwamp

提问by TheFlash

Okay so a continuation from this question, where you experts intro'd me to WAMP, which can basically execute PHP within a Windows XP environment.

好的,这是这个问题的延续,您的专家向我介绍了WAMP,它基本上可以在 Windows XP 环境中执行 PHP。

So now I've got it installed, but the tray icon forever shows YELLOW, and when I visit any PHP page in my browser, it just shows me the PHP source!

所以现在我已经安装了它,但是托盘图标永远显示为 YELLOW,当我在浏览器中访问任何 PHP 页面时,它只会向我显示 PHP 源代码!

Also, when I visit "http://localhost/" in IE7 it gives me a 404 Not Found, FF3 just shows a blankpage.

此外,当我在 IE7 中访问“ http://localhost/”时,它给了我一个404 Not Found,FF3 只显示一个空白页面。



BTW I've tried "Restart All Services" and restarting my machine, but it still won't work.

顺便说一句,我试过“重新启动所有服务”并重新启动我的机器,但它仍然无法正常工作。

Any ideas? Any of you had this problem and solved it?Please help me here, I'm desperate to execute PHP client-side and I'm just reverting to testing on-server for now!

有任何想法吗?你们中有人遇到过这个问题并解决了吗?请在这里帮助我,我迫切希望在客户端执行 PHP,我现在只是恢复到服务器上的测试!

回答by rzlines

Skype reserves port 80 for its incoming connection which conflicts with WAMP, so simply configure Skype to use another port by doing the following:

Skype 为其与 WAMP 冲突的传入连接保留端口 80,因此只需通过执行以下操作将 Skype 配置为使用另一个端口:

In Skype go to Tools|Options|Advanced|Connection uncheck the option --> Use port 80 and 443 as alternatives for incoming connections, that's it

在 Skype 中,转到工具|选项|高级|连接取消选中该选项 --> 使用端口 80 和 443 作为传入连接的替代,就是这样

For this change to take effect restart Skype and Restart all services on WAMP by doing the following:

要使此更改生效,请通过执行以下操作重新启动 Skype 并重新启动 WAMP 上的所有服务:

Left-click WAMP tray icon > Restart All Services"

左键单击 WAMP 托盘图标 > 重新启动所有服务”

Now Wamp and Skype can co-exist together, hope this solves your problem!!

现在 Wamp 和 Skype 可以共存了,希望这能解决您的问题!!

回答by TheFlash

Got it! Under the WAMP tray icon, left-click context menu > Apache> Service> Test Port 80, it said :

知道了!在WAMP 托盘图标下,左键单击上下文菜单 > Apache>服务>测试端口 80,它说:

"Your port 80 is actually usedby - Info not available, Must be Skype"

“您的80 端口实际上是由 - 信息不可用,必须是Skype

Well, so offgoes Skype, WAMP > Restart All Services, and Localhostshows "WAMP5 Homepage":

好吧,所以关闭Skype,WAMP > Restart All ServicesLocalhost显示“WAMP5 主页”:

Localhost WAMP CP
(source: wampserver.com)

本地主机 WAMP CP
(来源:wampserver.com

And, phpMyAdminworks, PHP scriptsexecute too. Wow!

而且,phpMyAdmin可以工作,PHP 脚本也可以执行。哇!

So now I can dubug in the proper fashion! Thank you StackOverflow!

所以现在我可以以适当的方式进行复制!感谢StackOverflow!

回答by Hossam Ghareeb

try this one, i had the same problem and this helped me:

试试这个,我遇到了同样的问题,这对我有帮助:

  1. Wamp Server icon => Appache => Service => Install Service
  2. Wamp Server icon => Appache => Service => Start/Resume Service
  3. Wamp Server icon => MySql => Service => Install Service
  4. Wamp Server icon => MySql => Service => Start/Resume Service
  1. Wamp 服务器图标 => Appache => 服务 => 安装服务
  2. Wamp 服务器图标 => Appache => 服务 => 启动/恢复服务
  3. Wamp 服务器图标 => MySql => 服务 => 安装服务
  4. Wamp 服务器图标 => MySql => 服务 => 启动/恢复服务

回答by deepika

just go to wamp>bin>apache>apache 2.2.17>conf>httpd.conf (file) change Listen 80to Listen 8080save the file n restart the services this time type http://localhost:8080

只需转到 wamp>bin>apache>apache 2.2.17>conf>httpd.conf (file) 更改Listen 80Listen 8080保存文件 n 这次重新启动服务键入http://localhost:8080

回答by EllisGL

Teamviewer can cause this too.

Teamviewer 也可能导致这种情况。

回答by John McCollum

Glad you got it sorted - Skype is notorious for that.

很高兴你把它整理好了 - Skype 是臭名昭著的。

If you want to use Skype and WAMP together, you can edit your httpd.conf file - change the 'listen' value from 80 to something else and restart all services.

如果您想同时使用 Skype 和 WAMP,您可以编辑您的 httpd.conf 文件 - 将 'listen' 值从 80 更改为其他值并重新启动所有服务。

回答by jason

you can start Skype up after wamp is online or change Skypes port not to use 80

您可以在 wamp 在线后启动 Skype 或将 Skypes 端口更改为不使用 80

回答by jchapa

I'd like to expand on what some of the other folks have contributed here - as Skype is not always the culprit.

我想扩展一些其他人在这里所做的贡献 - 因为 Skype 并不总是罪魁祸首。

You can also check exactly which process is hogging your port 80 by running this from a command prompt:

您还可以通过从命令提示符运行此命令来准确检查哪个进程占用了您的端口 80:

netstat -ao

netstat -ao

This will list all processes using ports with their PID. You can correlate those to processes in Task Manager, and take appropriate action from there. The bottom line is - you're looking for what's hogging port 80 and/or 443 (if you're connecting over SSL), as that is the default browser port.

这将列出所有使用端口及其 PID 的进程。您可以将这些与任务管理器中的进程相关联,并从那里采取适当的措施。底线是 - 您正在寻找占用端口 80 和/或 443(如果您通过 SSL 连接)的内容,因为这是默认浏览器端口。

回答by Adil

For me, when I have opened the httpd.conf file I have found that I have tow Listen statement as following:

对我来说,当我打开 httpd.conf 文件时,我发现我有如下的 Listen 语句:

Listen 80
Listen 169.254.96.77:80

and when I have commented the second line (adding '#' at beginning of the line) I restarted all wamp services (left click of wamp icon in the task bar), the wamp icon became green!

当我评论第二行(在行首添加“#”)时,我重新启动了所有 wamp 服务(左键单击任务栏中的 wamp 图标),wamp 图标变为绿色!

Hope this help other.

希望这可以帮助其他人。

回答by usama sulaiman

Most of the time this problem happens because of conflict between apachi servers, or ports, or duplicate of wamp installation

大多数情况下,此问题是由于 apachi 服务器或端口之间的冲突或 wamp 安装重复造成的

So to fix that:

所以要解决这个问题:

First of all if you are using SKYPE try to change the port by opening Skype, then:

首先,如果您使用的是 SKYPE,请尝试通过打开 Skype 来更改端口,然后:

  • Tools menu
  • Options
  • Advanced Options
  • Connections
  • Then uncheck "Use port 80 and 443 ......"
  • save
  • restart Skype
  • 工具菜单
  • 选项
  • 高级选项
  • 连接
  • 然后取消选中“使用端口 80 和 443 ......”
  • 节省
  • 重启Skype

second if the problem still exists try to find if you are using - or was using - other Apache server (for example XAMPP server), if so try to remove it and after removing it, go to regedit by:

其次,如果问题仍然存在,请尝试查找您是否正在使用 - 或正在使用 - 其他 Apache 服务器(例如 XAMPP 服务器),如果是,请尝试将其删除,并在删除后通过以下方式转到 regedit:

  • press on keyboard the "windows" button + "r" button, this will open the Run command
  • type "regedit" (without "")
  • open Edit menu then Find (you can press "CTRL" button + "F" button)
  • search for anything belongs to the other apache server and delete it (You should be careful while you are doing this step)
  • 按键盘上的“windows”按钮+“r”按钮,这将打开运行命令
  • 输入“regedit”(不带“”)
  • 打开编辑菜单然后查找(您可以按“CTRL”按钮+“F”按钮)
  • 搜索属于其他apache服务器的任何内容并将其删除(执行此步骤时应小心)