How to start XAMPP in Terminal Mac OSX

How to start XAMPP in Terminal Mac OSX

In the latest version of XAMPP, they removed the GUI to start stop Apache as well as other services (MYSQL,FTP etc). You have to use command line on terminal to start stop Apache Server. Documentation can be found on XAMPP site it self, However they do not show the exact command to stop stop. Here is quick tutorial how to start stop XAMPP

  1. Start Terminal. Issue this command to go where XAMPP is installed
  2. Issue the following command.  You have to use SUDO because this command needs root level privilege. Note that ./ is important. It indicates xampp is in the current folder

Or you can do it in one step by issuing the following command

Fixing Security Issues (login)

When you access localhost it might prompt you for user name and and password. The default username is “xampp”, the password is the one that you already set. If you have issue accessing the site, you simply need to reset username and password. Run the following command to do that. This will fix issues with the login

Start XAMPP using GUI

Click here to Start XAMPP using GUI on Mac

Using Path

In the comments of “How to start XAMPP in Terminal Mac OSX”, there were suggestions about using alias for the command. The problem with alias is they are temporary and are lost as soon as you close the Terminal Window. You have to recreated them each time you open the terminal.

A better approach is to add xampp to system path so you do not have to type complete path each time you run this command. You can follow this easy tutorial how to modify path variable on mac. In short, issue this command

1. Enter your user name and password (it will prompt for it)
2. Edit the file, add the path, /Applications/XAMPP/xamppfiles, at the bottom of the file in a new line
3. Hit Command + O to write the file
4. Close the terminal completely and re-open it again.

Now you can use use xamppt start command directly in the terminal