Set up Prestashop in a local server in Mac OS

This is a just a short summary of the steps and some troubleshooting to configure a Prestashop environment in a localhost server in a Mac OS machine. My trials were with Prestashop 1.6 in OS X Yosemite 10.10.5.

For Prestashop to work, it needs an Apache Server and a MySQL environment with PHP support. So, the two popular options to enable these in a Mac OS machine are

and

I will explain the configuration with both in this article. I found the MAMP installation to be smoother and needing less tinkering than the XAMPP one. But MAMP was huge compared to XAMPP!

With MAMP

— — — — — — — -

  1. Download the MAMP package file from the link.
  2. Install the package by double-clicking on it. It will be a simple installation with not much inputs required from the user.
  3. The following window will open up
MAMP console

4. Tap on Start Servers to start both the Apache and the MySQL Servers.

5. Navigate to http://localhost:8888/MAMP/index.php to access the localhost now. This lists the MySQL and PHP configuration details and links to them.

6. Tap on phpMyAdmin to navigate to http://localhost:8888/MAMP/index.php?page=phpmyadmin&language=English

7. Now, we can create an empty database here by tapping on Databases and suppling a name to be used by PrestaShop. I called it prestatrial.

8. Tap on this newly created DB and you can see the server instance where this DB is available. This info will be necessary later.

Note down the Server Location from here

9. Navigate to the Databases section, next to the databases, there is a link to Check Privileges, click on that to reach the DB’s Settings, click on Edit Privileges and then click on Change Password. Supply a password to the DB. This will be necessary to get Prestashop to connect to the DB with MAMP.

10. Now, onto Prestashop installation. Navigate to http://www.prestashop.com/en/download. Download and save a copy of the zip file downloaded. Extract the files too.

11. Navigate to MAMP’s root folder which is usually at Applications/MAMP/htdocs.

12. Copy the extracted files to this location under a new folder named Prestashop. (Ensure that the folder is the parent folder of the multiple files & folders like Adapter, Cache etc).

13. Point the browser to http://localhost:8888/prestashop/install/ . This should open up the custom Prestashop installation page (for possible errors, check the troubleshooting section here). Follow the steps to proceed with the installation. A valid user ID and password is to be supplied along with some basic info about the shop to be created. These credentials will be needed to access the admin panel of your shop.

14. When the Database details are asked for, copy the server info from Step 8. The server location should be something like localhost:8889 and the DB name should be the one shown there as well.

15. Use the password created in Step 9 for the password field with username as root.

16. Check DB connection with the link provided after the necessary info is filled up.

17. If everything goes fine, installation can be triggered(for possible errors, check the troubleshooting section here).

18. Once this is done and success message is received, navigate to the prestashop folder under htdocs and delete the ‘install’ folder. Very important step.

19. The summary screen shows two sections — one for customers and one for the admin to manage the site. Tap on both to navigate to the respective sites. For me it was http://localhost:8888/prestashop/ and http://localhost:8888/prestashop/admin788cbi0lh/ for admin.

20. For accessing the admin panel, the credentials used in the Prestashop installation in Step 13 needs to be supplied. This is where most of the configuration for the site is done.

Troubleshooting with MAMP

  1. If the DB connection throws error,
ensure that the server location of the DB matches from Step 8, the DB is as created and the password is set in the DB instance.

2. If PrestaShop installation page doesn’t open up automatically,

Go to /Applications locate /MAMP. Right click, to bring in the Get Info menu. Change permissions of Everyone to Read and Write. Click the settings icon in bottom and apply this setting to sub folders. Now close Get Info menu.

With XAMPP

— — — — — — — -

  1. Download the XAMPP dmg from here.
  2. Install the package by double-clicking on it.
  3. Once installation is complete, start the the MySQL server and MyPHPAdmin instances there.
  4. Check http://127.0.0.1/phpmyadmin.
  5. For me, the next steps varied greatly between multiple installations that I tried. If the steps listed here don’t work, please check the troubleshooting section listed here.
  6. Login with ‘root’ and empty password in PHPMyAdmin. You should see a list of databases.
  7. Now, we can create an empty database here by tapping on Databases and suppling a name to be used by PrestaShop. I called it prestatrial.
  8. Tap on this newly created DB and you can see the server instance where this DB is available. This info will be necessary later.
  9. If you want to supply a password to this DB (unlike MAMP, XAMPP didn’t insist on this for PrestaShop installation to be smooth), navigate to the Databases section, next to the databases, there is a link to Check Privileges, click on that to reach the DB’s Settings, click on Edit Privileges and then click on Change Password. Supply a password to the DB.
  10. Now, onto Prestashop installation. Navigate to http://www.prestashop.com/en/download. Download and save a copy of the zip file downloaded. Extract the files too.
  11. Navigate to XAMPP’s root folder which is usually at /Applications/XAMPP/xamppfiles/htdocs/. Create a new folder ‘prestashop’ and extract under there.
  12. Go to http://127.0.0.1/prestashop/install. Follow the steps. Ensure the db name matches one in Step 7.
  13. Go to http://127.0.0.1/prestashop/ to access the store and http://127.0.0.1/prestashop/admin to access the admin portal. Use the credentials supplied by you during installation.

Troubleshooting with XAMPP

  1. If PHPMyAdmin doesn’t open up,
Go to the application folder. Navigate to /Applications/XAMPP/xamppfiles/phpmyadmin. Find config.inc.php.
Check Serer auth type in there, change from ‘config’ to ‘cookie’

2. If PrestaShop installation page doesn’t open up automatically,

Go to /Applications locate /XAMPP. Right click, to bring in the Get Info menu. Change permissions of Everyone to Read and Write. Click the settings icon in bottom and apply this setting to sub folders. Now close Get Info menu.

That’s it, Prestashop is waiting now for you to play with it. For a server installation and set up, the links are going to be different and also, you need to use a File Manager to upload the Prestashop folder to htdocs in the server.

P.S 1: I can’t believe this whole thing is free! A shop ready in minutes. And live in possibly few hours. I know I still have to play with it a lot, but I got the whole thing here with troubleshooting and all and more in half a day.

P.S 2: A new story is on the works for using webservices exposed from Prestashop. Typically this will be great for a mobile app connecting to Prestashop as its backend provider while having its own user interface for the shop. Link to be updated soon.