How to Install XAMPP 1.7.3 on Mac OS X

XAMPP Mac OSNOTE TO READERS: This blog is only relevant for versions of XAMPP prior to 1.8.3.  Since the release of XAMPP 1.8.3, Apache Friends has synced up all the capabilities for Linux, Mac OS and Windows versions and fixed the problems addressed in this blog. Now you just load with the installer script and everything works right out of the box.

XAMPP provides a convenient means of getting a LAMPP system up and running. XAMPP rolls the Apache web server, FTP server, PHP and MySQL subsystems into a single installation package. It also includes phpMyAdmin which is an easy to use browser interface to manage your MySQL database.

There are versions of XAMPP for Linux, Windows and the Mac OS X. XAMPP is installed and configured diffferently on each of these platforms due to the XAMPP revision included in the package and the quirks of the underlying OS.  In this article I’ll cover how to setup XAMPP on the MacOS in order to get everything working properly.

Mac OS X Installation Procedure

  1. Download the latest XAMPP for Mac – 1.7.3 as of this writing – on the XAMPP MacOS X page.
  2. Open the DMG package and drag the XAMPP folder into your /Applications folder. All the XAMPP files are contained in the /Applications/XAMPP/xamppfiles folder with links to cgi-bin, htdocs, etc and logs folders.
  3. Start the Apache, MySQL and FTP servers by clicking on the button for each of these services in the XAMPP Contol Panel.  Each of the service lights should show green like this:

  1. Open http://localhost in a browser. You should a get a browser window with the XAMPP for Mac OS X startup screen:

  1. At this point most of the setup work for XAMPP is done.  However, if you plan to use phpyMyAdmin you’ll have to do a little further configuration to get it to work properly.
    Open phpMyAdmin by clicking on the phpMyAdmin link in the XAMPP window under Tools or enter http://locahost/phpmyadmin in your browser.  You will be taken directly to the phpMyAdmin page with some messages at the bottom of the screen telling you that you have to deal with some configuration issues relate to the phpMyAdmin database and that a root password is not set for MySQL.  Let’s deal with each of these problems.
  2. XAMPP does not create all the tables that phpmyadmin needs so you have to do this with an SQL script that is enclosed with the package. To do this click on the Import tab in the toobar at the top of the screen.

  1. Click on the Choose button in the File to import section.

  1. Choose the create_tables.sql script in /Applications/XAMPP/xamppfiles/phpmyadmin/scripts folder.
  2. Click on the Go button in the Format of imported file to run the script which will add all the tables you need to the phpmyadmin database.
  3. Open the Terminal application.
  4. Change to root user by typing:
  5. Open /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php in your editor of choice.
  6. Uncomment the following lines in the config.inc.php file.
    $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 
    $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma_relation';
    $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    $cfg['Servers'][$i]['history'] = 'pma_history';
  7. Add the following $cfg parameter to this list.

    $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
  8. Change the authentication type as follows:

    $cfg['Servers'][$i]['auth_type'] = 'cookie';
  9. To set a root password for phpmyadmin click on the Privileges in the XAMPP Control Panel toolbar.
  1. Click on the edit icon in the column to the right on the User Overview table for the root account on localhost.
  1. Click on the Password radio button in the Change password section of the Edit Privileges: User ‘root’@’localhost’ page.
  1. Enter the new password then re-type the password.
  2. Click on the Go button to save the new password.
  3. Repeat steps 17 – 20 for root on 127.0.0.1.
  4. Close your browser then restart Apache and MySQL in the XAMPP Control Panel.
  5. Open phpMyAdmin in your browser.  This time you’ll be take to a phpMyAdmin login screen.
  6. Login as root using password you set in step 19.

If everything went well you’ll go to the phpMyAdmin main screen and see a green Exit icon under the phpMyAdmin frame on the left side of the screen.  You can now create other databases and tables with phpMyAdmin.

Author:


41 Comments

Chelsea on March 2, 2013 at 8:44 am.

After you make changes to config.inc.php file, do you save it? I’m getting an error trying to update it.

Reply

vic on March 2, 2013 at 9:11 am.

Yes you save it then restart XAMPP. Do you have the right permissions to edit the file?

Reply

Chelsea on March 2, 2013 at 9:31 am.

Hi Vic! Thanks for your reply!

Probably not! Can you advise how to edit my permissions to edit this?! Can I control this at the editor level?

Reply

vic on March 2, 2013 at 9:39 am.

Ok you’ll have to edit your config.php file as root. Try this out:

1. Open your Terminal application. It should be in /Applications/Utilities.
2. Type: sudo su
3. Use your login password
4. Open config.inc.php in your editor.

Now you should be able to save the changes to the file. Let me know how it goes.

Reply

Chelsea on March 2, 2013 at 5:36 pm.

Hi Vic!

Thanks for all your help! I used the Terminal steps you provided and downloaded a new version of TextWrangler and had no issue!

Thanks for all your help! This was a great tutorial! :)

Reply

vic on March 2, 2013 at 8:35 pm.

Glad to hear it Chelsea. After you get comfortable with XAMPP for Mac OS try it on Linux. The Linux version has a later version of PHP and, if I’m not mistaken, MySQL also.

Reply

Sam on April 24, 2013 at 10:56 am.

Hi Vic,
I am trying to install Joomla using XAMPP so I can develop a website before I purchase hosting. I am not having much luck on my Mac (running Lion.) Any help would be greatly appreciated.

Reply

vic on April 24, 2013 at 3:40 pm.

I have not done that myself, but I found this documentation on the Joomla home website that might be helpful – http://docs.joomla.org/Xampp. Thanks for visiting my website.

Reply

Sam on May 1, 2013 at 4:55 pm.

Thank you for your response, Vic. I should have asked a more specific question, I had not done enough research when I asked that first question. My problem is this: I cannot edit the config.inc.php file because it is locked. When I use the “sudo su” command in terminal, it seems to work fine – I get the response “sh-3.2#” after entering my admin password. However, I still cannot edit the config file in text and I still cannot unlock it for editing. It gives me the option to create a duplicate which I can edit, but I am not sure if creating a duplicate will accomplish step 15 as instructed on your site. I am running Lion.
Also, for the sake of brevity, once I have access edit this file I would just like to check and make sure “uncommenting” the lines of code you instruct entails removing the “//” from the beginning of the lines. I greatly appreciate any help you can offer, as well as your website which is well written and very accessible. Thanks in advance!
Sam

Reply

vic on May 1, 2013 at 10:57 pm.

It may be that config.inc.php is not writable by anyone. After getting to root level access with ‘sudo su’ go to the /Applications/XAMPP/xamppfiles/phpmyadmin then type

chmod a+rw config.inc.php

That will make the file writable by anyone. Then uncommenting any given line involves removing the ‘//’ from the beginning line as you say.

Reply

albar on December 15, 2013 at 7:52 am.

Hi Vic, I’m stuck when trying to change config.inc.php
after I did all the steps above, still not work. and this from the terminal

“sh-3.2 # / Applications / XAMPP / xamppfiles / phpmyadmin
sh: / Applications / XAMPP / xamppfiles / phpmyadmin: is a directory
sh-3.2 # chmod a + rw config.inc.php
chmod: config.inc.php: No such file or directory”

can You tell me what is wrong, I run on maverick
Thanks everything

Reply

vic on December 15, 2013 at 1:52 pm.

I think you didn’t find config.inc.php because you were not in the right directory. Try these commands (note I’m using your command line prompts ‘sh-3.2 #’):

sh-3.2 # cd /Applications/XAMPP/xamppfiles/phpmyadmin
sh-3.2 # chmod a+rw ./config.inc.php

Then you can open the config.inc.php file with vi or whatever editor you want to use.

Reply

Andy on June 19, 2013 at 9:53 pm.

I’ve done all the things you’ve stated above
but still can’t yet save the config.inc.php file
what should i do now

Reply

vic on June 23, 2013 at 9:11 am.

You should be able to edit the config.inc.php file as root.

Reply

Aditi on July 10, 2013 at 12:05 am.

The error i get is
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

when i click on phpadmin after dragging the dmg to the applications folder, please help? I already tried clearing my cookies and browsing data.

Reply

vic on July 11, 2013 at 3:46 pm.

You have to follow the directions in my blog starting at step 5. Go through each step after that carefully and you should be OK. Let me which step is a problem and I’ll try to help you figure it out.

Reply

mr.didie on July 22, 2013 at 11:12 am.

i’m stuck at STEP 9..it said could not import config, like this…

Uploaded with ImageShack.us

Reply

mr.didie on July 22, 2013 at 11:21 am.

ok, sir, i was found the solution :)

Reply

Alfonso on August 7, 2013 at 2:12 pm.

Hmm it lоoks lіke your blog ate my firѕt сomment (іt wаs super
long) so I gueѕѕ I’ll just sum it up what I wrote and say, I’m thoroughly еnјoying your blοg.

Ι аs well am an aspiring blog writeг but I’m still new to everything. Do you have any recommendations for inexperienced blog writers? I’d gеnuinely аpрrecіate it.

Reply

Eduardo Wöetter on August 10, 2013 at 9:12 am.

I’ve done everything listed above, but on step 22 Xampp doesn’t start MySQL Database.
I click repeatedly on start button, it says it’s Starting but after awhile it stops.
Tried to boot osx too but no success.
I’ve already uninstalled and then installed Xampp once again, done all the steps above — and again the same issue.
Don’t know what’s going on.

Reply

vic on August 10, 2013 at 10:54 am.

You could try looking at the error_log file in your XAMPP folder. Open a terminal then type the following command:

tail -f /Applications/XAMPP/logs/error_log

Then start MySQL to see what log entries pop up. Let me know what you find out.

Reply

yuni on August 11, 2013 at 9:46 pm.

hai vic , can you help me? i have problem in step 10. We must open Terminal and type : Open /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php but my Terminal said “No such file or directory” can you give me a solution ? thank you :)

Reply

vic on August 12, 2013 at 12:45 pm.

My guess is the installation did not go so well. Reinstall XAMPP then type ‘ls /Applications/XAMPP/xamppfiles/phpmyadmin/’. You should see config.inc.php there. To edit it you’ll need to su to root by typing ‘sudo su’ then giving your password – not the root password. If that succeeds then you can edit it config.inc.php with ‘vi’.

I hope this helps.

Reply

Jartholemue on August 13, 2013 at 4:31 pm.

Where the crap is the control palel

Reply

vic on August 13, 2013 at 6:14 pm.

/Applications/XAMPP

Reply

cynthia on September 3, 2013 at 7:39 am.

Hi, I just installed XAMPP for Mac OS X 1.8.3 but I can’t start MySql. When I check status it says deactivated. I have uninstalled and reinstalled many times but the problem is still there. How do I activated MySql?

Thanks,
Cynthia

Reply

vic on September 3, 2013 at 9:11 am.

I just downloaded and installed the same version. MySQL starts up successfully for me. If you post some logs, perhaps I can help you figure out what it going wrong.

Reply

hemanth on September 16, 2013 at 5:41 am.

i want to use mysql phpmyadmin and netbeans for running java project is Xammp is suitable for tis?

Reply

vic on September 17, 2013 at 1:47 pm.

I have not built a Java application for xampp. My suggestion would be to use Tomcat for that.

Reply

Pedro on October 15, 2013 at 9:29 am.

I’ve installed the latest XAMPP (1.8.3-1) on my machine running os x 10.7.5. When I get to step 3, Apache will not start. When I browse to http://localhost, I get the “It Works” page that I get using the local web host I set up with Terminal.

Is there a way to turn off (stop, disable, whatever the word is) the local web host so that I can run XAMPP instead?

Thanks for your attention.

Reply

vic on October 15, 2013 at 2:37 pm.

Here is an article that describes how to start and stop the httpd which comes with the Mac – http://www.cyberciti.biz/faq/restarting-apache-under-oxs-commandline/. I hope this helps.

Reply

Xenio on January 18, 2014 at 4:29 am.

Any idea how can I install Xampp for Mac in different directory?
I have a 128gb SSD Drive for Applications and I like to have the Xampp on another drive.
Thanks

Reply

vic on January 24, 2014 at 11:47 am.

I don’t see any way to install somewhere else with the standard Mac install package. However you can move most of the files to another location if you do the following:

1. Install XAMPP in /Applications
2. sudo su
3. cd /Applications/XAMPP
4. mv xamppfiles/ /Volumes/extdrive (assuming you call your external drive “extdrive”)
6. ln -s /Volumes/extdrive/xamppfiles xamppfiles

The last step satisfies all the symbolic links in /Applications/XAMPP that point to the xamppfiles folder. This seemed to work in my environment.

Reply

Xenio on January 25, 2014 at 1:23 am.

Thank you, I will try the symbolic link solution for XAMPP, for now I am using MAMP that allow htdocs to be anywhere.

Reply

Breithof on January 28, 2014 at 5:38 am.

Hi,

I can’t find the create_table.sql and there’s no scripts folder under phpmyadmin. I’m running Xampp 1.8.3. Any ideas how to set this up? Many thanks.

Reply

vic on January 28, 2014 at 10:10 am.

For XAMPP 1.8.3 the steps involved in setting up phpMyAdmin are not necessary. I’ll add a comment to the blog that mentions my article is relevant only to 1.7.3. Thanks for your input.

Reply

Dragovich on January 30, 2014 at 4:33 am.

hi vic

am tryin to install it on my mac and am stuck at step 13,
it says that i cant make changes to the file unless i duplicate the file.
should i go through ?

Reply

vic on January 30, 2014 at 9:07 am.

The steps I outline in this blog are for 1.7.3. If you get the latest Xampp 1.8.3 for Mac OS, you just install and go. Apache Friends has cleaned up the version so they all install more easily.

Reply

Pam on February 19, 2014 at 6:35 am.

Dear Vic,

I am stuck at this point.

Change to root user by typing:

Open /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php in your editor of choice.

How do I move on from this point because once i type in the above, it opens up Dream weaver.

Please help as I am stuck.

Thanks.

Pam.

Reply

vic on February 19, 2014 at 8:09 am.

I you use the latest XAMPP you don’t have to worry about changing to root. I suggest you use that version.

Reply

Leave Your Comment

Your email will not be published or shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>