Skip to content

Instantly share code, notes, and snippets.

@djandyr
Last active September 19, 2023 19:17
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save djandyr/3c083bd1790aeecd1c9e to your computer and use it in GitHub Desktop.
Save djandyr/3c083bd1790aeecd1c9e to your computer and use it in GitHub Desktop.
XAMPP Automatically start Apache (MacOS)

Automatically start XAMPP Apache when logging into MacOSX.

  1. Create xampp.startapache.plist in /Library/LaunchDaemons with the following content :
<?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>Label</key>
    <string>org.xampp.server</string>
  <key>ProgramArguments</key>
    <array>
      <string>/Applications/XAMPP/xamppfiles/xampp</string>
      <string>startapache</string>
  </array>
  <key>RunAtLoad</key>
    <true/>
  <key>AbandonProcessGroup</key>
    <true/>
  </dict>
</plist>
  1. Run the following commands
sudo chown root:wheel /Library/LaunchDaemons/xampp.startapache.plist
sudo chmod 644 /Library/LaunchDaemons/xampp.startapache.plist
sudo launchctl load -w /Library/LaunchDaemons/xampp.startapache.plist

XAMPP will automatically start apache on startup, the LaunchDaemon can be modified if needed to start Apache, MySQL, ProFTPd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment