XAMPP can't start Apache on Mac - macos

manager-osx flicks from "Starting…" back to "Stopped" with no error, and when I run sudo /Applications/XAMPP/xamppfiles/ctlscript.sh start apache on the command line, I get back:
Syntax OK
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
I've tried port swapping and running sudo apachectl stop to stop the built in server (as described at XAMPP can't start Apache in mac), but no luck. Open port scan doesn't show any live Apache servers on my machine. I've reinstalled XAMPP (multiple different versions), but nothing.
Running macOS Catalina 10.15.1.
Update: I've also tried using MAMP, and it can't start Apache either.

sudo /Applications/XAMPP/xamppfiles/xampp start
run this command to Start XAMPP on MacOS Catalina.

Related

Have only one Apache running on macOS Big Sur

Via brew I installed an Apache Server with PHP 7.4 running, however it seems that there are two servers and two different PHP versions running.
On localhost phpinfo() shows 7.4 however on 127.0.0.1 phpinfo() shows 7.3
The localhost phpinfo() shows it's running on brew, however on 127.0.0.1 it seems that the built-in Apache is running, it shows Built-in HTTP server
Stopping Apache via sudo apachectl stop stops the brew one from working (localhost), but the built-in (127.0.0.1) is still running it seems.
which -a apachectl shows
/usr/local/bin/apachectl
/usr/sbin/apachectl
Any tips on how to stop the built-in one and only have the brew one running are gladly welcomed!
Thx!

Why doesn't homebrew apache start at startup?

I’m trying to figure out why my apache doesn’t start at startup… (I would like for it to).
My OS: OSX Mojave
Impressions I’m under: that I’m running homebrew’s apache
Upon a fresh boot…
If I hit http://localhost in a browser I get
Unable to connect
Firefox can’t establish a connection to the server at localhost.
Fire up terminal…
$brew services list
returns
httpd started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.php.plist
(That first line makes me think httpd is running and I should be able to hit localhost).
$which -a apachectl
returns
/usr/local/bin/apachectl
/usr/sbin/apachectl
then
$apachectl configtest
returns
Syntax OK
then
$sudo apachectl -V
returns (among other things)
-D SERVER_CONFIG_FILE="/usr/local/etc/httpd/httpd.conf"
(Isn’t this brew’s httpd.conf?)
There's a brew command (which I forget) that I already ran that is supposed to run httpd at startup.
Once I run
$sudo apachectl start
everything is jake. So it’s a low-priority question, but one I would like to solve and understand.
I had the same issue with Homebrew NGINX.
Running the brew services command with sudo solved the problem for me.
It appears that the Homebrew web-server packages require sudo to start | stop | restart.
Try running:
sudo brew services start apache2

Can't change document root for apache 2.4

I want to set up local web server using Apache and PHP on my Mac running Sierra. I followed this tutorial:
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions
And I am stuck at changing the document root from httpd.config, for whatever reason this change does not take effect at all. If I type http://localhost it still says "It works", it still uses the original html file.
Another weird thing is that apparently I can't stop apache at all. I tried running
$ sudo apachectl stop
but I still can’t access http://localhost
if I run
$ brew services list
httpd24 is stopped. What gives? What am I doing wrong?
There is an instance of apache pre-installed with macOS. So you have now two versions of apache installed. If you check:
which apachectl
you will probably obtain:
/usr/sbin/apachectl
which is the official macOS version of apachectl. Stop it with:
sudo apachectl stop
Disable the auto-loading of the pre-installed apache with (as explained in the tutorial you mentioned):
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
To run the homebrew version do:
brew services run httpd24
to stop it:
brew services stop httpd24
to register it to launch at login:
brew services start httpd24

I have 2 versions of Apache running on my system

There is another version of apache running on my system.
When in run sudo apachectl stop I still get the "It Works" page
So I found the location of the other version that is still running and it looks to be an older version which probably came pre-installed and is located in /opt/local/apache2/.
I tested this file /opt/local/apache2/htdocs/index.html.sample by just changing the text and then checked the browser again.
Server: Apache/2.2.29 (Unix)
I want to remove that one and keep the latest version which is located in private/etc/apache2
Server version: Apache/2.4.9 (Unix)
How can I do this safely.
I managed to fix this
I ran ps aux | grep apache to see the apache processes
I then ran sudo apachectl stop
Then sudo killall -9 httpd to kill all apache processes
Then sudo apachectl restart
I went to the browser and typed localhost~/username/sitename
Bingo it works again, my system is using the correct version of apache again!

Cannot stop Tomcat6 installed via Macports in Mac OS X 10.7.3

I am using Mac OS X 10.7.3. I installed tomcat6 via macports 2.0.4. I put the tomcat6 location in myeclipse for spring 10 server configuration. Everything was fine so far.
Then I tried to start it in myeclipse. It could not start, saying something like 8080 port is already in use.
Then I went to terminal.
ps aux | grep tomcat
4 process showed up. It seemed tomcat6 started automatically after the installation. Then I tried to stop it with
sudo tomcatctl stop
Here came the problem. No matter how I tried, it always says
Stopping Tomcat...(pid ****)............... giving up.
I tried to kill the process but it kept starting tomcat again right after the kill.
How do I stop it and let myeclipse take over it? Any help is appreciated.
Thanks,
Milo
try doing sudo port unload tomcat6
This command replaced interacting with launchctl yourself, but im unsure if it supports a -w switch which would typically remove the launch daemon were it used with launchctl unload meaning you wouldnt run into the magic restart problem.

Resources