4

I had a local XAMPP stack running on my Macbook Pro fine for weeks (OS X Yosemite 10.10.3, XAMPP 5.5.24). Then, I spent some time trying to install a library, in which I somehow messed up the installation of XAMPP. Now Apache does not start up at all anymore. This is what I tried.

Start up Apache

$ sudo /Applications/XAMPP/xamppfiles/xampp startapache
XAMPP: Starting Apache...fail.
XAMPP:  Another web server is already running.

$ sudo /Applications/XAMPP/xamppfiles/xampp stopapache
XAMPP: Stopping Apache...not running.

So I try to find which web server is already running.

Zombie apaches

I check for zombie apaches.

$ sudo lsof | grep AMP | grep apache
$ ps -x | grep apache
 7980 ttys000    0:00.00 grep apache
$ ps -x | grep AMP
 7990 ttys000    0:00.00 grep AMP

So I don't see any webserver running.

Skype

I close Skype. Still the same problem.

Other listeners on port 80

I checked for other listeners on port 80, as suggested in mnfc's answer.

$ lsof -i -P | grep -i "listen"
SpotifyWe  267 erwin    6u  IPv4 0x45f774a11f61c26b      0t0  TCP localhost:4370 (LISTEN)
SpotifyWe  267 erwin    7u  IPv4 0x45f774a11f61b99b      0t0  TCP localhost:4380 (LISTEN)
Dropbox    281 erwin   26u  IPv4 0x45f774a11f5b926b      0t0  TCP localhost:17603 (LISTEN)
Dropbox    281 erwin   27u  IPv4 0x45f774a12399b65b      0t0  TCP *:17500 (LISTEN)
Dropbox    281 erwin   33u  IPv4 0x45f774a117b1665b      0t0  TCP localhost:17600 (LISTEN)

$ netstat -atp tcp | grep -i "listen"
tcp46      0      0  *.ftp                  *.*                    LISTEN     
tcp46      0      0  *.mysql                *.*                    LISTEN     
tcp4       0      0  localhost.17600        *.*                    LISTEN     
tcp4       0      0  localhost.17603        *.*                    LISTEN     
tcp4       0      0  *.17500                *.*                    LISTEN     
tcp4       0      0  localhost.4380         *.*                    LISTEN     
tcp4       0      0  localhost.4370         *.*                    LISTEN     
tcp46      0      0  *.http                 *.*                    LISTEN     
tcp4       0      0  localhost.ipp          *.*                    LISTEN     
tcp6       0      0  localhost.ipp          *.*                    LISTEN     

$ lsof -i :80
COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
firefox 7929 erwin   41u  IPv4 0x45f774a12db287fb      0t0  TCP erwins-mbp.fritz.box:59555->ea-in-f113.1e100.net:http (ESTABLISHED)
firefox 7929 erwin   48u  IPv4 0x45f774a134b4a65b      0t0  TCP erwins-mbp.fritz.box:59558->190.93.244.58:http (ESTABLISHED)
firefox 7929 erwin   54u  IPv6 0x45f774a117aff4eb      0t0  TCP [2001:981:b88a:1:7467:5734:ba5f:58b8]:59565->ea-in-x65.1e100.net:http (ESTABLISHED)
firefox 7929 erwin   56u  IPv4 0x45f774a11f61a7fb      0t0  TCP erwins-mbp.fritz.box:59574->ec2-23-21-247-182.compute-1.amazonaws.com:http (ESTABLISHED)
firefox 7929 erwin   58u  IPv4 0x45f774a125dc499b      0t0  TCP erwins-mbp.fritz.box:59575->ec2-23-21-247-182.compute-1.amazonaws.com:http (ESTABLISHED)
firefox 7929 erwin   59u  IPv4 0x45f774a12db2999b      0t0  TCP erwins-mbp.fritz.box:59566->104.16.13.8:http (ESTABLISHED)
firefox 7929 erwin   60u  IPv4 0x45f774a134b5199b      0t0  TCP erwins-mbp.fritz.box:59569->ip-82-94-234-88.ams.byte.nl:http (ESTABLISHED)
firefox 7929 erwin   63u  IPv4 0x45f774a12db6d7fb      0t0  TCP erwins-mbp.fritz.box:59576->93.184.220.29:http (ESTABLISHED)
firefox 7929 erwin   65u  IPv4 0x45f774a13ae124bb      0t0  TCP erwins-mbp.fritz.box:59579->a23-52-59-27.deploy.static.akamaitechnologies.com:http (ESTABLISHED)
firefox 7929 erwin   67u  IPv4 0x45f774a1275404bb      0t0  TCP erwins-mbp.fritz.box:59568->ip-82-94-234-88.ams.byte.nl:http (ESTABLISHED)
firefox 7929 erwin   69u  IPv4 0x45f774a134b43b3b      0t0  TCP erwins-mbp.fritz.box:59581->server-54-230-130-235.ams50.r.cloudfront.net:http (ESTABLISHED)
firefox 7929 erwin   70u  IPv4 0x45f774a12db69b3b      0t0  TCP erwins-mbp.fritz.box:59577->104.16.13.8:http (ESTABLISHED)

As super user:

$ sudo lsof -i -P | grep -i "listen"
Password:
launchd      1           root   26u  IPv6 0x45f774a117b02beb      0t0  TCP localhost:631 (LISTEN)
launchd      1           root   34u  IPv4 0x45f774a117b19b3b      0t0  TCP localhost:631 (LISTEN)
launchd      1           root   35u  IPv4 0x45f774a117b19b3b      0t0  TCP localhost:631 (LISTEN)
launchd      1           root   45u  IPv6 0x45f774a117b02beb      0t0  TCP localhost:631 (LISTEN)
httpd       74           root    4u  IPv6 0x45f774a117b026eb      0t0  TCP *:80 (LISTEN)
SpotifyWe  267          erwin    6u  IPv4 0x45f774a11f61c26b      0t0  TCP localhost:4370 (LISTEN)
SpotifyWe  267          erwin    7u  IPv4 0x45f774a11f61b99b      0t0  TCP localhost:4380 (LISTEN)
Dropbox    281          erwin   26u  IPv4 0x45f774a11f5b926b      0t0  TCP localhost:17603 (LISTEN)
Dropbox    281          erwin   27u  IPv4 0x45f774a12399b65b      0t0  TCP *:17500 (LISTEN)
Dropbox    281          erwin   33u  IPv4 0x45f774a117b1665b      0t0  TCP localhost:17600 (LISTEN)
httpd      311           _www    4u  IPv6 0x45f774a117b026eb      0t0  TCP *:80 (LISTEN)
httpd     1227           _www    4u  IPv6 0x45f774a117b026eb      0t0  TCP *:80 (LISTEN)
mysqld    1832         _mysql   24u  IPv6 0x45f774a117b00deb      0t0  TCP *:3306 (LISTEN)
proftpd   1911         daemon    0u  IPv6 0x45f774a117afe5eb      0t0  TCP *:21 (LISTEN)

Erwins-MBP:~ erwin$ sudo lsof -i :80
COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
httpd     74  root    4u  IPv6 0x45f774a117b026eb      0t0  TCP *:http (LISTEN)
httpd    311  _www    4u  IPv6 0x45f774a117b026eb      0t0  TCP *:http (LISTEN)
httpd   1227  _www    4u  IPv6 0x45f774a117b026eb      0t0  TCP *:http (LISTEN)
firefox 8014 erwin   68u  IPv4 0x45f774a1462ac7fb      0t0  TCP erwins-mbp.fritz.box:64603->ee-in-f113.1e100.net:http (ESTABLISHED)
firefox 8014 erwin   74u  IPv4 0x45f774a12db290cb      0t0  TCP erwins-mbp.fritz.box:64598->190.93.246.58:http (ESTABLISHED)
firefox 8014 erwin   82u  IPv4 0x45f774a12db5399b      0t0  TCP erwins-mbp.fritz.box:64605->ip-82-94-234-98.ams.byte.nl:http (ESTABLISHED)

Kill other listeners on port 80

I wanted to kill the existing httpd processes. I first closed all other applications, including Firefox. When I try to kill them using sudo killall httpd or sudo kill 1227, they don't disappear. I still cannot start my Apache server then.

Complete fresh installation

I uninstalled XAMPP completely, removed the directory, and reinstalled XAMPP from the installation package. I rebooted my Macbook. Still the same problem.

XAMPP Manager OS X

2
  • What is inside apache logs? Commented Apr 30, 2015 at 13:34
  • Where can I find these logs? If they are the files in /Applications/XAMPP/logs, they are all empty. Commented May 4, 2015 at 6:20

3 Answers 3

10

After months of trying, I finally got it working. I found the solution here: disable OSX's built-in Apache server.

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
1
  • 1
    Man, you're the best Commented Mar 15, 2018 at 19:16
3

You should check for other processes bound on a TCP socket to port 80.

netstat -atp tcp | grep -i "listen"

Achive Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)   
tcp4       0      0  localhost.25035        *.*                    LISTEN
sudo lsof -i -P | grep -i "listen"

COMMAND     PID      USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
GitHub      850 grgarside   6u   IPv4 0x23c345381d089301      0t0  TCP localhost:25035 (LISTEN)
15
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
    – Fazer87
    Commented Apr 30, 2015 at 14:52
  • Spot on. The reason we ask that you include relevant information is that the Apple SO page you linked to could be deleted, changed, spammed/deformed.. which would not only kill that answer, but yours too. Also, you now get recognition for making effort insteaf of just being smart enough to copy/paste :)
    – Fazer87
    Commented Apr 30, 2015 at 15:00
  • You mean i now get recognition because i actually did copy/paste :D sorry for OT though
    – mnfc12
    Commented Apr 30, 2015 at 15:06
  • Thanks for the answer. I indeed had checked that already, but forgot to mention that in my post. I have added it now. Unfortunately, that did not give me any clue for a process that is blocking my Apache server. :-( Commented May 4, 2015 at 6:17
  • There is something, which listen. See line: tcp46 0 0 .http *. LISTEN Commented May 4, 2015 at 6:23
0

for anyone looking for an answer to start any server on Xamps(Been digging on this for way too long).

Do it via the terminal: I found this link definitely helped:

http://daplo.net/solved-mac-os-x-xampp-mysql-server-is-not-starting/

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

Apache- sudo /Applications/XAMPP/xamppfiles/bin/ftpdctl start

Hope that helps.

Cheers

1
  • 2
    This is a tangential answer to OP's question, which was about Apache not starting. I would also be surprised if ftpdctl started Apache...
    – bertieb
    Commented Mar 29, 2017 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .