How to uninstall apache from the command line on Mac?

Viewed 34922

I followed these directions to install apache for a class on the following link on the command line aka terminal:

https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/

but then my professor told me that we needed to install XAMPP 5.6.12 which will have packages including:

Apache 2.4.16
MySQL 5.6.26
PHP 5.6.12
phpMyAdmin 4.4.14 

So now I want to uninstall the current apache(Apache/2.4.25) on my mac so that I can install XAMMP which will already have apache and the other packages that I need for my gui class.

3 Answers

Now with macOS Catalina, the following sequence to disable the Apache HTTPD daemon is:

$ sudo apachectl stop
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

As to whether one should remove the /usr/sbin/http

sudo apachectl start to make sure it is running

go to http://localhost:80 to ensure you see "It Works!" or something comes up to confirm it is running.

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

cat /private/var/db/com.apple.xpc.launchd/disabled.plist should produce output similar to the following to show that httpd has been disabled from autostarting.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.ftpd</key>
    <true/>
    <key>com.apple.mdmclient.daemon.runatboot</key>
    <true/>
    <key>org.apache.httpd</key>
    <true/>
</dict>
</plist>
Related