Skip to content

Instantly share code, notes, and snippets.

@djandyr
Last active May 16, 2024 19:05
Show Gist options
  • 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.

@Dirk-K
Copy link

Dirk-K commented May 16, 2024

Thanks for the script! Works well with apache but mysql won't start. Please, would you post the correct script for mysql?

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