Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jerry-maheswara-github/c7d0383466221fffd303170c98db398a to your computer and use it in GitHub Desktop.
Save jerry-maheswara-github/c7d0383466221fffd303170c98db398a 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