php 为什么 Apache 不在 XAMPP 上启动

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

Why the Apache is not starting on XAMPP

phpapachexampp

提问by Thompson

Until yesterday everything was fine to my localhost, but starting yesterday, localhost is not opening. It's saying "Unable to connect".

直到昨天,我的本地主机一切都很好,但是从昨天开始,本地主机没有打开。它说“无法连接”。

I tried number of times to start the Apacheon XAMPP, but it is saying message that busy. The port 80 is busy, I hope.

我尝试了多次启动Apacheon XAMPP,但它说消息很忙。我希望 80 端口很忙。

I have tried every possible way to free the port 80. For example, Disabled option that "Use port 80" in Skypeand Teamviewer. I don't know which program is using the Port 80.

我已经尝试了所有可能的方法来释放端口 80。例如,在Skype和 中禁用“使用端口 80”选项Teamviewer。我不知道哪个程序正在使用端口 80。

How can I determine that which program is using the Port 80 and then stop it permanently and use port 80 as my localhost?

如何确定哪个程序正在使用端口 80,然后永久停止它并使用端口 80 作为我的本地主机?

采纳答案by Thompson

I deleted each and every file of XAMPP, and reinstalled the new version. Now it is working for me.

我删除了 XAMPP 的每个文件,并重新安装了新版本。现在它对我有用。

回答by Xfile

Have you messed up with httpd.confor php.ini?

你搞砸了httpd.conf还是php.ini

If not and it happened by itself, you might have to try this: Read Very Carefully

如果不是并且它自己发生了,你可能不得不尝试这个:阅读非常仔细

  • Go to c:/xammp/htdocs/folder, grab everything you need (all sites you need), and backup tn some map on your desktop.
  • Do the same with c:/xammp/mysql/datafolder too. Get all databases you need and backup those too in some mysql folderon desktop.
  • SAVEthat backup on DVD, CD , or maybe even a external HDD if you have one. Now you have your work saved.
  • 转到c:/xammp/htdocs/文件夹,获取您需要的所有内容(您需要的所有站点),然后在桌面上备份一些地图。
  • c:/xammp/mysql/data文件夹也做同样的事情。获取您需要的所有数据库,并mysql folder在桌面上的某些数据库中备份这些数据库。
  • 将该备份保存在 DVD、CD 或什至外部 HDD(如果您有的话)上。现在您的工作已保存。

After you did it, shutdown your PC for 20seconds.

完成后,关闭电脑20秒。

Turn your PC on, and:

打开你的电脑,然后:

  • Uninstall the whole xammp. Erase all of the folders and other files.
  • After you're done, shut down your PC again for 20seconds.
  • 卸载整个xammp. 删除所有文件夹和其他文件。
  • 完成后,再次关闭电脑20秒。

Turn your PC on, again, and:

再次打开你的电脑,然后:

  • Download the latest xammp 1.7.1and install
  • Start xammpIT MUST BE RUNNING!
  • 下载最新的xammp 1.7.1并安装
  • 启动xammp它必须运行!

P.S.:My guess is that some of file may be corrupt. If that isn't going to help, my second guess is that you HDD is on fire.

PS:我的猜测是某些文件可能已损坏。如果这没有帮助,我的第二个猜测是你的硬盘着火了。

So you might have to:

所以你可能必须:

  • Go to a store and buy new HDD
  • Install it
  • Set in BIOS command for new disk to be 1st boot
  • Install fresh copy of WinXP
  • Install Xammp
  • When is up and running, go to backup, and move sites (backup) to htdocs folder, and mysql/datato the same one in Xampps.
  • 去商店购买新硬盘
  • 安装它
  • 在 BIOS 命令中将新磁盘设置为第一次启动
  • 安装 WinXP 的新副本
  • 安装 Xammp
  • 当启动并运行时,转到备份,并将站点(备份)移动到 htdocs 文件夹,并移动mysql/dataXampps.

You will have everything like before.

你会像以前一样拥有一切。

At the end, use that new HDD for localhost exclusively (if youre doing important things), old HDD for playing around via Internet and stuff.

最后,将新硬盘专门用于本地主机(如果您正在做重要的事情),旧硬盘用于通过互联网和其他东西玩。

回答by Superbiji

On Linux (Run this as root):

在 Linux 上(以root身份运行):

netstat -taunp | grep LISTEN

Then you can see what process name running on what port.

然后您可以看到在哪个端口上运行的进程名称。

On Windows:(I used Windows XP and I don't know about compatibitlity)

在 Windows 上:(我使用的是 Windows XP,我不知道兼容性)

netstat -ao | find /i "listening"

You can see process ID on rightmost column. Press Ctrl+Alt+Delto show Task Manager, go to Process tab, open menu View > Select Column, show process identifier. Then find matching process name on that tab.

您可以在最右侧的列中看到进程 ID。按Ctrl+Alt+Del显示任务管理器,转到进程选项卡,打开菜单View > Select Column,显示进程标识符。然后在该选项卡上找到匹配的进程名称。

回答by Babu

If you have installed php on your c:drive, change port number 80to 81in C:\xampp\apache\conf\httpd.conf

如果你已经安装了PHP在你的c:驱动器,更改端口号8081C:\xampp\apache\conf\httpd.conf

#Listen 0.0.0.0:81
#Listen [::]:81
Listen 81