Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## XAMPP automatically start Apache and MySQL on MacOS startup
- ## https://jonathannicol.com/blog/2012/03/12/launching-xampp-at-osx-startup/
- ## https://gist.github.com/ozgrozer/aa3d0fe4d8c9ae8b04a3622f2e55fc04
- 1. Change directory.
- ```bash
- cd /Library/LaunchDaemons
- ```
- 2. Create Apache file for startup.
- ```bash
- sudo vim apachefriends.xampp.apache.start.plist
- ```
- 3. Put these into Apache file.
- ```xml
- <?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>EnableTransactions</key>
- <true/>
- <key>Label</key>
- <string>apachefriends.xampp.apache.start</string>
- <key>ProgramArguments</key>
- <array>
- <string>/Applications/XAMPP/xamppfiles/xampp</string>
- <string>startapache</string>
- </array>
- <key>RunAtLoad</key>
- <true/>
- <key>WorkingDirectory</key>
- <string>/Applications/XAMPP/xamppfiles</string>
- <key>KeepAlive</key>
- <false/>
- <key>AbandonProcessGroup</key>
- <true/>
- </dict>
- </plist>
- ```
- 4. Create MySQL file for startup.
- ```bash
- sudo vim apachefriends.xampp.mysql.start.plist
- ```
- 5. Put these into MySQL file.
- ```xml
- <?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>EnableTransactions</key>
- <true/>
- <key>Label</key>
- <string>apachefriends.xampp.mysql.start</string>
- <key>ProgramArguments</key>
- <array>
- <string>/Applications/XAMPP/xamppfiles/xampp</string>
- <string>startmysql</string>
- </array>
- <key>RunAtLoad</key>
- <true/>
- <key>WorkingDirectory</key>
- <string>/Applications/XAMPP/xamppfiles</string>
- <key>KeepAlive</key>
- <false/>
- <key>AbandonProcessGroup</key>
- <true/>
- </dict>
- </plist>
- ```
- 6. Restart your computer to test it out.
- ```bash
- sudo shutdown -r now
- ```
- ---
- Works on: MacOS Mojave 10.14.2, XAMPP 7.2.9-0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement