Shop talk

On p152 of the latest issue (PC Pro – Issue 134), you’ll find a feature on building an online shop, so here in the open-source world we’ve decided to do the same, but without the software costing us a penny. The first choice to be made is whether to use an existing piece of software or to make up your own. Although from a geeky point of view the latter approach has its appeal, in the real world there’s no point reinventing the wheel unless there’s a good reason to do so, and that being the case we took a look at the options already out there. We’ve used a number of these products ourselves on occasion, so we were pretty familiar with what’s available, and the choice rapidly narrowed itself down to one package:osCommerce (www.oscommerce.com).

Shop talk

osCommerce has been around since March 2000 and now claims to power more than 5,000 online shops around the world. It’s released under the GNU General Public License (GPL), which means it’s completely free to use and modify, and it contains an almost overwhelming array of features that should satisfy pretty much anyone who needs an online presence. However, as we’ll see later, this huge flexibility doesn’t come without its problems.

Getting Started

osCommerce is written in PHP and uses the MySQL open-source relational database management system as its back-end data store, so you’ll need to install it on a web server that’s running both of these programs. The standard setup is geared to run on Apache, but it will run just as well via Microsoft Internet Information Server (IIS).

To begin with, download the latest version of the software from www.oscommerce.com: the current version of this, at the time of writing, is 2.2-MS2 (where ‘MS’ stands for ‘milestone’, as this is the second key release of version 2.2). After extracting it from the TAR or ZIP archive (there’s no difference, other than the form of compression used), copy the directory named Catalog into your web server’s directory tree. If you’re running on a Unix box (and we hope you are), ensure the catalog/includes/configure.php file has permissions 777 set by running the command line ‘chmod 777 catalog/includes/configure.php’. You’ll also need to create a database within MySQL and a user with access permission for that database; you can do this via the command line or with a program such as phpMyAdmin.

Once you’ve done this, visit http://(your-server)/catalog/install to view the initial installation screen. However, contrary to the documentation, we discovered that osCommerce refuses to work if the PHP option ‘register_globals’ is turned off, which is the case with pretty much every new PHP installation these days, since register_globals is considered by some to be a security loophole. In order to get around this problem, you’ll need to either enable register_globals in your php.ini file (which will affect every site you’re hosting) or edit the htaccess file in the catalog directory and remove the comments from the lines at the bottom of the file, which refer to register_globals. (These lines turn register_globals on, but they’re commented out with # symbols in front of them to make the web server ignore them; removing the comment symbols means these lines will be executed.)

This done, go to your-server/catalog/install via your web browser and you’ll see a screen asking whether you want to install the software or upgrade from a previous version. Click Install, then Continue on the next page and you’ll see a screen similar to screenshot 1. Into the form field, you’ll need to enter the name of the database server, the username, password and database name you set up in MySQL earlier. Once you’ve done this, clicking Continue should take you to a page that allows you to run the database import procedure, which creates all the database tables osCommerce requires. If you get an error message, you’ve probably set up your database username or password incorrectly or you’re using older versions of PHP’s MySQL access libraries. Once you’ve imported the database tables, click on the button marked Administration and you’ll be taken to osCommerce’s main admin screen.

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

Todays Highlights
How to See Google Search History
how to download photos from google photos