macos XAMPP Apache Webserver localhost 不适用于 MAC OS

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

XAMPP Apache Webserver localhost not working on MAC OS

apachemacosxampp

提问by Amit Battan

I install XAMPP server on MAC OS 10.6 it was working fine. After a lot of days I checked it, but not working this time, localhost not opening this time.

我在 MAC OS 10.6 上安装了 XAMPP 服务器,它工作正常。很多天后我检查了它,但这次没有工作,这次localhost没有打开。

after some R&D I reinstall XAMPP server after uninstall

经过一些研发后,我在卸载后重新安装了 XAMPP 服务器

When I start the apache after reinstall it giving port 80 running a another webserver Then I restart system, then apache start ok, but same local host not working

当我在重新安装它后启动 apache 时,让端口 80 运行另一个网络服务器然后我重新启动系统,然后 apache 启动正常,但同一个本地主机不工作

Then I check Web Sharing in my System Preference then it was already Tuned Off ...

然后我在我的系统偏好设置中检查了网络共享,然后它已经被关闭了......

Please anybody tell me where I am wrong?

请有人告诉我我错在哪里?

回答by Yakov Fain

This is what helped me:

这对我有帮助:

sudo apachectl stop

This command killed Apache server that was pre-installed on MAC OS X.

这个命令杀死了预装在 MAC OS X 上的 Apache 服务器。

回答by Steve Clay

I had to disable OSX's built-in Apache server (XAMPP support thread):

我不得不禁用 OSX 的内置 Apache 服务器(XAMPP 支持线程):

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

This allowed XAMPP to start on 80, while POWruns on 20559.

这允许 XAMPP 从 80 开始,而POW在 20559 上运行。

What had failed: I reconfigured /etc/apache2/httpd.confto listen on an alternate port and rebooted OSX. No luck.

失败的原因:我重新配置/etc/apache2/httpd.conf为侦听备用端口并重新启动 OSX。没有运气。

回答by minhas23

This solution worked perfectly fine for me..

这个解决方案对我来说非常好..

1) close XAMPP control

1)关闭XAMPP控件

2) Open Activity Monitor(Launchpad->Other->Activity Monitor)

2) 打开活动监视器(Launchpad->其他->活动监视器)

3) select filter for All processes (default is My processes)

3)为所有进程选择过滤器(默认为我的进程)

4) in fulltext search type: httpd

4)全文搜索类型:httpd

5) kill all httpd items

5)杀死所有httpd项目

6) relaunch XAMPP control and launch apache again

6) 重新启动 XAMPP 控件并再次启动 apache

Hurray :)

万岁:)

回答by Sahil Doshi

try

尝试

sudo /Applications/XAMPP/xamppfiles/bin/apachectl start

in terminal

在终端

回答by Erica Santos

To be able to do this, you will have to stop apache from your terminal.

为了能够做到这一点,您必须从终端停止 apache。

sudo apachectl stop

After you've done this, your apache server will be be up and running again!

完成此操作后,您的 apache 服务器将再次启动并运行!

Hope this helps

希望这可以帮助

回答by Surya Wijaya Madjid

This is because in Mac OS X there is already Apache pre-installed. So what you can do is to change the listening port of one of the Apaches, either the Apache that you installed with XAMPP or the pre-installed one.

这是因为在 Mac OS X 中已经预装了 Apache。因此,您可以做的是更改其中一个 Apache 的侦听端口,无论是您随 XAMPP 安装的 Apache 还是预安装的 Apache。

To change the listening port for XAMPP's Apache, go to /Applications/XAMPP/xamppfiles/etc and edit httpd.conf. Change the line "Listen 80" (80 is the listening port) to other port, eg. "Listen 1234".

要更改 XAMPP 的 Apache 的侦听端口,请转到 /Applications/XAMPP/xamppfiles/etc 并编辑 httpd.conf。将“Listen 80”行(80 是侦听端口)更改为其他端口,例如。“听1234”。

Or,

或者,

To change the one for pre-installed Apache, go to /etc/apache2. You can do the same thing with file httpd.conf there.

要更改预安装的 Apache,请转到 /etc/apache2。您可以在那里对文件 httpd.conf 执行相同的操作。

After changing you might need to restart your Mac, just to make sure.

更改后,您可能需要重新启动 Mac,以确保。

回答by BKP

I had similar issue after integrating MongoDB into XAMPP. However executing the command "sudo apachectl stop" fixed the problem

将 MongoDB 集成到 XAMPP 后,我遇到了类似的问题。但是执行命令“sudo apachectl stop”修复了问题

回答by Kamlesh

Run xampp services by command line

通过命令行运行 xampp 服务

To start apache service

启动apache服务

sudo /Applications/XAMPP/xamppfiles/bin/apachectl start

须藤 /Applications/XAMPP/xamppfiles/bin/apachectl start

To start mysql service

启动mysql服务

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

须藤/Applications/XAMPP/xamppfiles/bin/mysql.server 启动

Both commands are working like charm :)

这两个命令都像魅力一样工作:)

回答by Steve Ham

Found out how to make it work!

找到了如何让它工作!

I just moved apache2 (the Web Sharing folder) to my desktop.

我刚刚将 apache2(Web 共享文件夹)移动到我的桌面。

  1. go to terminal and type "mv /etc/apache2/ /Users/hseungun/Desktop"

  2. actually it says you need authority so

  3. type this "sudo -s" then it'll go to bash-3.2

  4. passwd root

  5. set your password and then "mv /etc/apache2/ /Users/hseungun/Desktop"

  6. try turning on the web sharing, and then start xampp on mac

  1. 转到终端并输入“mv /etc/apache2/ /Users/hseungun/Desktop”

  2. 实际上它说你需要权威所以

  3. 输入这个“sudo -s”然后它会去bash-3.2

  4. 密码根

  5. 设置您的密码,然后“mv /etc/apache2/ /Users/hseungun/Desktop”

  6. 尝试打开网络共享,然后在mac上启动xampp

回答by user2021537

I was having this exact problem, the above solutions didn't make much sense to me.

我遇到了这个确切的问题,上述解决方案对我来说没有多大意义。

My Solution:

我的解决方案:

Turn of Bluetooth! Worked a treat ..

关闭蓝牙!辛苦了..

After connecting my macbook pro to iphone5 (hotspot) I started getting error message, after turning of bluetooth the error message is gone ..Hope that helps somebody!

将我的 macbook pro 连接到 iphone5(热点)后,我开始收到错误消息,打开蓝牙后,错误消息消失了..希望对某人有所帮助!