Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automatically start Xampp at login' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically start Xampp at login
Authored by: zonesny on Jan 28, '13 12:45:31PM

FWIW, I finally got both XAMPP apache and XAMPP mysql installs to run automatically on start up (I'm using OS 10.5.8 Leopard). These two posts set me in the right direction (very grateful to original posters!):

http://hints.macworld.com/article.php?story=20080128103022907

AND

http://hunterford.me/mysql-startup-item-for-mac-os-x/

To start Xampp's Apache Server, I created the following daemon (this .plist file should be placed in the Library/LaunchDaemons/ folder):


<?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>XAMPP APACHE START</string>
	<key>ProgramArguments</key>
	<array>
		<string>/applications/xampp/xamppfiles/xampp</string>
		<string>start</string>
	</array>
	<key>QueueDirectories</key>
	<array/>
	<key>RunAtLoad</key>
	<true/>
	<key>WatchPaths</key>
	<array/>
</dict>
</plist>

To start Xampp's mysql install, I created the following daemon (again place this .plist file in the Library/LaunchDaemons folder):


<?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>XAMPP MYSQL START</string>
	<key>Disabled</key>
	<false/>
	<key>GroupName</key>
	<string>_mysql</string>
	<key>KeepAlive</key>
	<true/>
	<key>Program</key>
	<string>/Applications/XAMPP/xamppfiles/bin/mysqld</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/XAMPP/xamppfiles/bin/mysqld</string>
		<string>--user=_mysql</string>
	</array>
	<key>QueueDirectories</key>
	<array/>
	<key>RunAtLoad</key>
	<true/>
	<key>Umask</key>
	<integer>7</integer>
	<key>UserName</key>
	<string>_mysql</string>
	<key>WatchPaths</key>
	<array/>
	<key>WorkingDirectory</key>
	<string>/Applications/XAMPP/xamppfiles</string>
</dict>
</plist>

    A couple of important notes:
  • The owner of these plist files needs to be "root" and the group needs to be "wheel" [in terminal type: sudo chown root:wheel XAMPP MYSQL START.plist and sudo chown root:wheel XAMPP APACHE START.plist]
  • Permissions should be 644. [in terminal type: chmod -644 for each file]
  • While apache and mysql will run correctly at startup, the actual "xampp control app" will still show a "red light" for mysql.
  • To stop mysql, go to the mac terminal type: top -u. This will show you the running processes. Look for the PID number of the mysqld process, press q, then type: kill [PID] (i.e. kill 123, or kill -123 to force quit).

This information was very difficult to locate for some reason. I hope it saves someone a lot of wasted time! ;)



[ Reply to This | # ]