php XAMPP:无法启动 Apache (Windows 10)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27333203/
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
XAMPP: Couldn't start Apache (Windows 10)
提问by Félix Desjardins
I'm using XAMPP, and I can start Apache, but, MySQL (phpMyAdmin) start!
我正在使用 XAMPP,我可以启动 Apache,但是,MySQL ( phpMyAdmin) 启动!
When I start, I get this error;
当我开始时,我收到这个错误;
10:07:49 [Apache] Error: Apache shutdown unexpectedly.
10:07:49 [Apache] This may be due to a blocked port, missing dependencies,
10:07:49 [Apache] improper privileges, a crash, or a shutdown by another method.
10:07:49 [Apache] Press the Logs button to view error logs and check
10:07:49 [Apache] the Windows Event Viewer for more clues
10:07:49 [Apache] If you need more help, copy and post this
10:07:49 [Apache] entire log window on the forums
I search on it, and, change the port of Apache in Config -> Service and Port setting. I have;
我搜索它,然后在配置 -> 服务和端口设置中更改 Apache 的端口。我有;
Service name : Apache2.4
Main Port : 122
SSL port : 444
I also uninstall Skype (Windows 8/10/Metro version). Nothing is working. In the httpd.conf I have;
我也卸载了 Skype(Windows 8/10/Metro 版本)。没有任何工作。在 httpd.conf 我有;
Listen 122
ServerName localhost:122
I start it via apache_start.bat
and get;
我通过它开始apache_start.bat
并得到;
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : AH00072: make_sock: could not bind to address [::]:445
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:445
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
Please note that all the logfiles don't exists!Skype is uninstalled.
请注意,所有日志文件都不存在!Skype 已卸载。
回答by Praveen Puglia
Update: 15th May, 2018:
更新:2018 年 5 月 15 日:
The latest Windows 10 update (re-)activated the World Wide Web Publishing Service(in German: WWW-Publishingdienst). This might depend on the options you select during the configuration of the update you can make afterwards.
最新的 Windows 10 更新(重新)激活了万维网发布服务(德语:WWW-Publishingdienst)。这可能取决于您在配置更新期间选择的选项,然后您可以进行更新。
Update: 4th August, 2015:
更新:2015 年 8 月 4 日:
If you have done clean installation of Windows 10, you may not have the Word Wide Web Publishing Service. In that case, simple WAMP/XAMPP installation should work fine.
如果您已完成 Windows 10 的全新安装,则您可能没有Word Wide Web Publishing Service。在这种情况下,简单的 WAMP/XAMPP 安装应该可以正常工作。
If it doesn't, try installing Visual C++ Redistributableand then re-install WAMP/XAMPP.
如果没有,请尝试安装Visual C++ Redistributable,然后重新安装 WAMP/XAMPP。
I was facing a similar problem with WAMP. In Windows 10 TP, the Word Wide Web Publishing Servicecomes pre-installed. This is related to IIS and you can remove it if you don't need it.
我在使用 WAMP 时遇到了类似的问题。在 Windows 10 TP 中,预装了Word Wide Web Publishing Service。这与 IIS 相关,如果不需要,可以将其删除。
This blocks the port 80
, making Apache act weirdly. You can do the following and try again.
这会阻塞端口80
,使 Apache 行为异常。您可以执行以下操作并重试。
- Go to Start, type in services.msc
- Scroll down in the Services window to find the World Wide Web Publishing Service.
- Right click on it and select Stop.
- 转到开始,输入services.msc
- 在“服务”窗口中向下滚动以查找万维网发布服务。
- 右键单击它并选择停止。
This should make port 80free and restarting WAMP/XAMPP should get you up and running!
这应该会使端口80空闲,并且重新启动 WAMP/XAMPP 应该会让您启动并运行!
There are other ways to do fix this. See Make WAMP Work On Windows 10.
还有其他方法可以解决这个问题。请参阅使 WAMP 在 Windows 10 上工作。
回答by DIANGELISJ
Solving this problem is easy:
解决这个问题很容易:
- Open a command prompt with administrator privileges
- Find "cmd", right-click on it, then select "Administrator".
- In the prompt, type
net stop W3SVC
and Enter.
- 以管理员权限打开命令提示符
- 找到“cmd”,右键单击它,然后选择“管理员”。
- 在提示中,键入
net stop W3SVC
并回车。
You can now click in WAMPP and restart all services. Open your browser and navigate to "localhost".
您现在可以单击 WAMPP 并重新启动所有服务。打开浏览器并导航到“localhost”。
If you need to start W3SVC again,
如果您需要再次启动 W3SVC,
- Open a command prompt with administrator privileges
- In the prompt, type
net start W3SVC
and Enter.
- 以管理员权限打开命令提示符
- 在提示中,键入
net start W3SVC
并回车。
回答by Fazal
I found a way to solve this problem:
我找到了解决这个问题的方法:
- If you are using Skype as well, uncheck the field stating to use ports 80 and 443 (Extra -> Settings -> Advanced -> Connections -> Uncheck Port 80 and 443)
- Restart Skype and XAMPP.
- 如果您也使用 Skype,请取消选中声明使用端口 80 和 443 的字段(额外 -> 设置 -> 高级 -> 连接 -> 取消选中端口 80 和 443)
- 重新启动 Skype 和 XAMPP。
If this does not work,
如果这不起作用,
- Go to Start and type "services.msc"
- Locate "World Wide Web Publishing Service"
- Right-click on that entry, select "Stop", then restart XAMPP.
- 转到“开始”并键入“services.msc”
- 找到“万维网发布服务”
- 右键单击该条目,选择“停止”,然后重新启动 XAMPP。
If that did not work and "World Wide Web Publishing Service" was not available,
如果这不起作用并且“万维网发布服务”不可用,
- Go to the Control Panel, navigate to "Uninstall Programs", then "Turn on/off Windows features"
- Locate "Internet Information Services"
- Click the checkbox and hit "OK".
- Restart, then repeat the second approach (services.msc)
- 转到控制面板,导航到“卸载程序”,然后“打开/关闭 Windows 功能”
- 找到“互联网信息服务”
- 单击复选框并点击“确定”。
- 重新启动,然后重复第二种方法(services.msc)
回答by Experimenter
You can change the port of apache:
您可以更改apache的端口:
- Go to C:\xampp\apache\conf\httpd.
- Find by combination Ctrl+F line #Listen 12.34.56.78:80 and change the 80 to any you like for example 81
- The same with Listen 80 change to 81
- The same with ServerName localhost:80 change to 81.
- Go to C:\xampp\apache\conf\extra\httpd-vhosts and change 80 to 81
- 转到 C:\xampp\apache\conf\httpd。
- 通过组合 Ctrl+F 行查找 #Listen 12.34.56.78:80 并将 80 更改为任何您喜欢的,例如 81
- 同听 80 改为 81
- 同样与ServerName localhost:80 更改为81。
- 转到 C:\xampp\apache\conf\extra\httpd-vhosts 并将 80 更改为 81
NameVirtualHost *:80 here
NameVirtualHost *:80 这里
VirtualHost *:80 and here (two times)
VirtualHost *:80 和这里(两次)
- Restart apache
- 重启apache
To enter your web page type: http://localhost:81/index.html
要输入您的网页类型:http://localhost:81/index.html
回答by Do Nhu Vy
1.Press Windows+R, type regedit
1.按Windows+ R,输入regedit
2.Go to
2.前往
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
Change the value of Start
to 4, which means disabled.
将 的值更改Start
为 4,表示禁用。
3.Reboot your computer
3.重启你的电脑
回答by Paul Carlton
I have fixed this issue with mine as well but what I had to do was change a couple things. I require that on my Win10 machine I keep my C# and VS development environment so I didn't want to tinker with any services. All I had to do was download the latest version of XAMPP and change the listening ports for 80 and 443. They were located in 2 files:
我也解决了这个问题,但我必须做的是改变一些事情。我要求在我的 Win10 机器上保留我的 C# 和 VS 开发环境,所以我不想修补任何服务。我所要做的就是下载最新版本的 XAMPP 并更改 80 和 443 的侦听端口。它们位于 2 个文件中:
C:\xampp\apache\conf\httpd.conf
C:\xampp\apache\conf\httpd.conf
Listen 122
ServerName localhost:122
C:\xampp\apache\conf\extra\httpd-ssl.conf
C:\xampp\apache\conf\extra\httpd-ssl.conf
Listen 444
Changing above from port 80 to 122 and 443 to 444 allowed me to have apache run and serve pages while keeping everything else the same for my ASP development. Hopefully this helps someone out there. In the end this is a very simple fix.
将上面的端口从 80 更改为 122 以及将 443 更改为 444 允许我运行 apache 并提供页面,同时为我的 ASP 开发保持其他所有内容相同。希望这可以帮助那里的人。最后,这是一个非常简单的修复。
Direct your browser to: http://localhost:122
将您的浏览器定向到: http://localhost:122
回答by Tarik
I tried everything listed in the answers here but none of them worked.
我尝试了此处答案中列出的所有内容,但没有一个奏效。
Then all I did was to re-start XAMPP with administrator rights by:
然后我所做的就是通过以下方式以管理员权限重新启动 XAMPP:
Start menu - right click on XAMPP - select run as administartor
开始菜单 - 右键单击 XAMPP - 选择以管理员身份运行
It worked. It is that simple.
有效。就是这么简单。
I uninstalled IIS services, stopped WWW services, changed ports back to 80, blocked all apache and mysql connections from windows 10 firewall, but yes it still works!
我卸载了 IIS 服务,停止了 WWW 服务,将端口更改回 80,阻止了来自 Windows 10 防火墙的所有 apache 和 mysql 连接,但是它仍然有效!
回答by Dipak Bari
I got same problem, but the above solutions leads us to change the port instead of getting the exact solution. I've searched about the ports of simple HTTP & HTTPS Protocols and found
我遇到了同样的问题,但上述解决方案导致我们更改端口而不是获得确切的解决方案。我搜索了简单的 HTTP 和 HTTPS 协议的端口,发现
If another application is already running the http or https ports on local machine, we'll get this problem obviously just because of those ports already in use and in busy state.
如果另一个应用程序已经在本地机器上运行 http 或 https 端口,我们显然会因为这些端口已经在使用并且处于繁忙状态而遇到这个问题。
That's why after changing the port number it was working. But instead of changing the port in XAMPP server I've used the following methods and It's works for me.
这就是为什么在更改端口号后它可以工作的原因。但是我没有更改 XAMPP 服务器中的端口,而是使用了以下方法,它对我有用。
Here's the following step which I've got during this fix up.
这是我在此修复过程中完成的以下步骤。
- Error which I got in XAMPP Server application.
- 我在 XAMPP 服务器应用程序中遇到的错误。
- At the top corner there's a button named Netstat. It's very useful for looking up the running ports on the system.
- 在顶角有一个名为Netstat的按钮。它对于查找系统上正在运行的端口非常有用。
- This is the Netstat application where I found an application already running and using the port no. 443. In my case It was vmware-hostd.exe. Your might be different application. Try to search for port 80 (HTTP) or port 443 (HTTPS).
- 这是 Netstat 应用程序,我发现一个应用程序已经在运行并使用端口号。443. 就我而言,它是vmware-hostd.exe。您可能是不同的应用程序。尝试搜索端口 80 (HTTP) 或端口 443 (HTTPS)。
- I just opened the windows task manager, selected that application vmware-hostd.exeand kill the process by using the End Processbutton. I've killed that process which was used port 443. And this application wasn't needed at the moment.
- 我刚刚打开 Windows 任务管理器,选择该应用程序vmware-hostd.exe并使用“结束进程”按钮终止该进程。我已经杀死了使用端口 443 的那个进程。目前不需要这个应用程序。
- After killing the application in windows task manager, Apache is now available at the moment. Here's the proof.
- 在 windows 任务管理器中杀死应用程序后,Apache 现在可用。这是证据。
NOTE:If you found any kind of application which is used the httpor httpsports means port 80or port 443and the application isn't important or not vital then only kill the process of that application. Otherwise no need to follow this steps. Then you need to consider to change the port of your XAMMP application as stated on the above answers.
注意:如果您发现使用http或https端口的任何类型的应用程序意味着端口80或端口443并且应用程序不重要或不重要,则仅终止该应用程序的进程。否则无需执行此步骤。然后,您需要考虑更改 XAMMP 应用程序的端口,如上述答案所述。
回答by Gujarat Santana
It looks like there are many options answer it is depend on your windows. Here is my experience when having the same problem in windows 10 fresh install and fix the issue with the following step :
看起来有很多选项,答案取决于您的窗户。这是我在 Windows 10 全新安装中遇到相同问题时的经验,并通过以下步骤解决问题:
- Install Visual C++ Redistributable
- Open XAMPP and select config in apache service
- Change the port 80 to 9000 or 81 or whatever you want in httpd.conf on the line
Listen 80
- Change the port on httpd-ssl.conf and change
Listen 443
toListen 441
- restart XAMPP and start apache service, and it work for me.
- 安装Visual C++ Redistributable
- 打开XAMPP,在apache服务中选择config
- 在httpd.conf里把80端口改成9000或者81或者随便你就行
Listen 80
- 更改 httpd-ssl.conf 上的端口并更改
Listen 443
为Listen 441
- 重新启动 XAMPP 并启动 apache 服务,它对我有用。
NOTE : I'm using XAMPP Version 5.6.15 and XAMPP Control Panel version 3.2.2
注意:我使用的是 XAMPP 5.6.15 版和 XAMPP 控制面板 3.2.2 版
回答by Msquared86
After playing around, really all you have to do is change two lines in the httpd.conf file:
玩完之后,实际上您要做的就是更改 httpd.conf 文件中的两行:
Change "Listen 80"to "Listen 122"(or anything else you want)
将“听 80”更改为“听 122”(或您想要的任何其他内容)
and
和
"ServerName Localhost:80"to "Localhost:122"(or the port you changed above)
“ServerName Localhost:80”到“Localhost:122”(或者你在上面更改的端口)
Then it all should fire right up :P
那么这一切都应该立即启动:P