简体   繁体   English

XAMPP Apache Web 服务器本地主机无法在 MAC 操作系统上运行

[英]XAMPP Apache Webserver localhost not working on MAC OS

I install XAMPP server on MAC OS 10.6 it was working fine.我在 MAC OS 10.6 上安装了 XAMPP 服务器,它工作正常。 After a lot of days I checked it, but not working this time, localhost not opening this time.很多天后我检查了它,但这次没有工作,这次 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...然后我在我的系统偏好设置中检查 Web 共享然后它已经关闭了......

Please anybody tell me where I am wrong?请有人告诉我我哪里错了吗?

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 服务器。

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 POW runs on 20559.这允许 XAMPP 从 80 开始,而POW在 20559 上运行。

What had failed: I reconfigured /etc/apache2/httpd.conf to listen on an alternate port and rebooted OSX.失败的原因:我重新配置/etc/apache2/httpd.conf以侦听备用端口并重新启动 OSX。 No luck.没有运气。

try试试

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

in terminal在终端

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 :)万岁:)

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希望这有帮助

This is because in Mac OS X there is already Apache pre-installed.这是因为在 Mac OS X 中已经预装了 Apache。 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.因此,您可以做的是更改其中一个 Apache 的侦听端口,无论是您随 XAMPP 安装的 Apache 还是预安装的 Apache。

To change the listening port for XAMPP's Apache, go to /Applications/XAMPP/xamppfiles/etc and edit httpd.conf.要更改 XAMPP 的 Apache 的侦听端口,请转到 /Applications/XAMPP/xamppfiles/etc 并编辑 httpd.conf。 Change the line "Listen 80" (80 is the listening port) to other port, eg.将“Listen 80”行(80 是侦听端口)更改为其他端口,例如。 "Listen 1234". “听1234”。

Or,或者,

To change the one for pre-installed Apache, go to /etc/apache2.要更改预安装的 Apache,请转到 /etc/apache2。 You can do the same thing with file httpd.conf there.你可以用 httpd.conf 文件做同样的事情。

After changing you might need to restart your Mac, just to make sure.更改后,您可能需要重新启动 Mac,以确保。

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 :)这两个命令都像魅力一样工作:)

I had similar issue after integrating MongoDB into XAMPP.将 MongoDB 集成到 XAMPP 后,我遇到了类似的问题。 However executing the command "sudo apachectl stop" fixed the problem但是执行命令“sudo apachectl stop”修复了问题

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(热点)后,我开始收到错误消息,打开蓝牙后,错误消息消失了..希望对某人有所帮助!

If you are also running skype at the same time.如果您同时运行Skype。 It will give you error:它会给你错误:

port 80 running a another webserver运行另一个网络服务器的端口 80

First close skype and restart your apache it will work fine.首先关闭Skype并重新启动您的apache它会正常工作。

I had success with easy killing all active httpd processes in Monitor Activity tool:我成功地在 Monitor Activity 工具中轻松杀死了所有活动的 httpd 进程:

1) close XAMPP control 1)关闭XAMPP控件

2) open Monitor Activity 2)打开监控活动

3) select filter for All processes (default is My processes) 3)为所有进程选择过滤器(默认为我的进程)

4) in fulltext search type: httpd 4)全文搜索类型:httpd

5) kill all showen items 5)杀死所有显示的项目

6) relaunch XAMPP control and launch apache again 6) 重新启动 XAMPP 控件并再次启动 apache

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"转到终端并输入“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输入这个“sudo -s”然后它会去bash-3.2

  4. passwd root密码根

  5. set your password and then "mv /etc/apache2/ /Users/hseungun/Desktop"设置您的密码,然后“mv /etc/apache2/ /Users/hseungun/Desktop”

  6. try turning on the web sharing, and then start xampp on mac尝试打开网络共享,然后在mac上启动xampp

In my case, Web Sharing was running, which blocked XAMPP.就我而言,网络共享正在运行,这阻止了 XAMPP。

'Untick' Web Sharing in the Bluetooth Settings (or Network), which causes HTTPD to show in activity log.在蓝牙设置(或网络)中“取消勾选”网络共享,这会导致 HTTPD 显示在活动日志中。

Apache should now run and be available! Apache 现在应该可以运行并可用了!

Same thing as mine on OS X Mavericks.和我在 OS X Mavericks 上的一样。

After a couple of trials by error while changing Apache configuration, I got weird output on localhost/xampp.在更改 Apache 配置时进行了几次错误试验后,我在 localhost/xampp 上得到了奇怪的输出。 Thought PHP engine was messed up.以为 PHP 引擎搞砸了。 However, 127.0.0.1/xampp is working completely okay.但是,127.0.0.1/xampp 工作正常。

Finally, I cleaned up the browser cache and reload the page again and Voila!最后,我清理了浏览器缓存并再次重新加载页面,瞧!

Resolved on Firefox...已在 Firefox 上解决...

As Reid mentioned above in one comment you can also do it like this:正如Reid在上面的一条评论中提到的,您也可以这样做:

  1. Quit XAMPP Manager-osx退出 XAMPP Manager-osx
  2. Run in terminal: sudo killall httpd在终端中运行: sudo killall httpd
  3. Restart your XAMPP servers重新启动您的 XAMPP 服务器

... and you should be good to go! ......你应该很高兴去!

The issue in my case was valet and I didn't know it's using port 80 .我的问题是valet ,我不知道它正在使用端口80 If you want to use XAMPP, just stop valet by typing valet stop and run the XAMPP.如果您想使用 XAMPP,只需键入valet stop停止valet ,然后运行 XAMPP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM