From Zen Cart(tm) Wiki
Jump to: navigation, search
Warning.png To Do!
This page needs an entry for configuring a Mac as a server.


This page deals with the steps needed to configure a computer as a local html/php server, so that you can have a copy of Zen Cart for development and testing. Configuring a web host involves security issues beyond the scope of this page. The process varies significantly between operating systems, so we have a separate section for each of the three major OS's.


Setting up a linux box as a Zen Cart™ Server is trivial, although the details will vary slightly depending on the distribution you are using. Note I specify restart in step 3. This will generate a harmless error when it attempts to stop a process (which you can ignore) if a process is not running. We do this just in case something has already been installed and is running without your knowledge.

Here's all you have to do:

  1. Ensure that PHP, Apache, and MySQL are installed.;
    yum -y install php, mysql mysql-server php-mysql
    sudo apt-get install apache2 php5 libapache2-mod-php5 mysql mysql-server
  2. Configure the new services to install automatically:
    • /sbin/chkconfig httpd on
    • /sbin/chkconfig mysqld on
  3. (Re)start services:
    • /sbin/service httpd (re)start
    • /sbin/service mysqld start
  4. Set up the mysql admin password. Without a password any user on the box can login to mysql as database root. The mysql root account is a separate password form the machine root account:
    • mysqladmin -u root password 'new-password'</code>
  5. Some additional MySQL security steps:
    • mysql -u root -p [login to mysql as root]
    • mysql> DROP DATABASE test; [remove the test database]
    • mysql> DELETE FROM mysql.user WHERE user = ; [remove anonymous access]
    • mysql> FLUSH PRIVILEGES;
  6. Create a database and user for your data. The GRANT statement creates a new MySQL user account. user and password can be chosen freely.
    • mysql> CREATE DATABASE db_name;
    • mysql> GRANT ALL PRIVELEGES ON db_name.* TO 'user'@'localhost'IDENTIFIED BY 'password'



Installing Apache, MySQL and PHP

First, you will need server software and accessories (Apache or other server, MySQL, PHP etc.) These can be installed individually, but if you have the skill to do that you probably don't need this guide. Numerous open source packages are available. To make local work most relevant to the remote site, it makes sense to choose software as similar as practical. You will probably also need a utility to extract zip or gzip files, again readily available in open source. Note: Zen Cart™ through v1.2.7 is not compatible with MySQL 5.x - see Troubleshooting-Errors-1054. This is addressed in newer v1.3.x editions.

Install the server package per the supplier's instructions (it will probably be quite simple.) It is good to locate it near the root (C:\ or C:\Program Files). If you mess up at any point you can uninstall or delete everything and start over. You will then want to create a database using phpMyadmin, probably accessible through the server admin. Don't worry about where it goes; MySQL takes care of that. Don't move the db or it will be lost. You will later import the downloaded db information from a .sql file or similar.

You will install the site files in a subdirectory you create in (probably) \<server>\htdocs\ or the like (sometimes referred to as C:\internet\). Phpinfo will give Document Root, which is the part of the file path that will be replaced by ''http://localhost/'' when typing your local site address in the browser.

Open source server packages

(Anyone with knowledge of other systems, please add that information.)

NOTE: THESE PACKAGES ARE **NOT** SUITABLE FOR USE ON A LIVE PRODUCTION WEBSERVER. They should only be used on a home/office PC used for testing and offline development. They are not secure enough to be used as a real live webserver.

XAMPP: Easy to install and use, though it would help to have some idea of what to expect before starting. Minor glitches probably due to my initial inexperience and old computer. Support site primarily German but with an English section (all docs available in English).

EasyPHP: Additionally, There is another Open Source Local Server package available, it is EasyPHP and can be found here EasyPHP, I only have experience with this distribution, but found it simple to install and use.

WAMP: Easy to install and use. Current release has Apache2, MySQL5 and PHP5. Extensions available include PHP4, MySQL Admin and Zend Optimizer. Documentation is sparse, but administration controls are awesome. Had it up and running on WinXP in less than an hour and easily added both Drupal and Zen Cart™ test sites.