Friday, October 13, 2006

How to install OpenEMR with XAMPP in WindowsXP

Disclaimer: This 'howto' manual is written based on my personal experience while trying to implement OpenEMR in my clinic. I use Windows XP as a platform of trial and transform my Windows XP to become a local server using XAMPP.

Okay, before we go through the details on the 'how to', I just would like to recap on what is OpenEMR and XAMPP.

OpenEMR is a modular, HIPAA compliant, Open Source, cross-platform Electronic Medical Records system (EMRS). It facilitates efficient office management through automated patient record journaling and billing integration, and has been successfully integrated with third-party technologies including speech recognition, secure wireless access, touch screen portables, and biometric authentication. Interface screens are customizable and optimized for consistency, simplicity, speed of access to patient information, and minimum eye strain. OpenEMR is based upon widely-used public standards to achieve maximum compatibility with evolving technologies. Adherence to these standards diversifies implementation possibilities through minimum hardware compatibility requirements.

In short, it is an application to run your clinic management and patients database with a lot of room to expand.


XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start. Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl.

In short, XAMPP will make your Windows XP as a server for you to host your OpenEMR.

Few thing we need to consider before we go through:

  1. To run OpenEMR in your Windows XP is not as straightforward as installing another applications with an .exe extension in Windows.

  2. It will take some your time and effort to get the whole thing running.

  3. OpenEMR is a browser based application, means you need to install OpenEMR in a server and run the application using your web browser. I personally recommend Firefox with Google toolbar.

  4. I have not try this on a Linux and Mac. If you want to try to install it on those platform, check out from http://www.oemr.org.

  5. OpenEMR is developed in the US. Some of the medical variables and parameters on the applications may not be compatible with your local and country settings. The good news is, OpenEMR is an open source project, which means if you know how to write PHP code, you can change and modify the source code to tailor to your local clinic and country settings.

  6. I consider my attempt still in a very early stage. I appreciate any feedback from you.

  7. Discussion on implementing OpenEMR will be discuss in OpenEMR forum.

Installation of XAMPP.

Choose which distribution to install. I choose a stable production release. Because OpenEMR use PHP4 and mySQL4 to run, I use XAMPP 1.4.16 version. Newer version of XAMPP will not do the job properly.

Download the distribution you want to install. I downloaded the XAMPP 1.4.16 installer, xampp-win32-1.4.16-installer.exe, from the Apache Friends organization's Web site. Look for 'Older versions of XAMPP (even the "old" WAMPP) can downloaded directly from SourceForge' and download the package from there. Make sure you download the installer file.

Install the distribution. Installation of XAMPP is very easy. Just unpack and run the .exe package on the partition of your choice. I chose the default, creating the main directory in C:\Program files\xampp.

During the set up, you will be informed about installing Apache, mySQL and Filezilla services into your computer. Just agree with all the default settings.

Perform post-installation setup.
  1. By default, XAMPP services will start with PHP5 after you finished the installation. You need to switch PHP5 to PHP4 (because OpenEMR cannot run properly with PHP5).

  2. You need to stop Apache services first before the changes takes place. To do this, open XAMPP Control Panel Application (start menu > apachefriends > xampp > control xampp server panel)

  3. Select 'stop' apache services under 'modules'.

  4. Switch your PHP5 version to PHP4. To do this, select 'php switch' from the start menu. (start menu > apachefriends > xampp > php switch).

  5. A window with command prompt will pop out. Change your PHP to PHP4.

  6. Restart Apache services.

To make sure that you install XAMPP properly, open 'CONTROL XAMPP SERVER PANEL' from Start Menu > All Programs > apachefriends > xampp. Click 'Admin...' from the Apache service modules. It should open your browser and show this:



The URL address should be http://localhost/xampp/.

Installation of OpenEMR

Choose which distribution to install. I use the latest stable production release. For our project with Windows, it was the openemr-2.8.1.tar.gz version from SourceForge.net.

Download the distribution you want to install.

Install the distribution. For installation, follow the steps below:

  1. Extract the downloaded file using WinZip. When you unzip, the package will become a folder. Rename the folder as 'openemr' and move the folder to 'htdocs' folder in C:\Program files\xampp\htdocs.

  2. You then need to do some script editing. Use WordPad or any text editor to open globals.php file, which is in C:\apachefriends\xampp\htdocs\openemr\interface.

  3. At about line 10, look for this line $webserver_root = "/var/www/html/openemr";

  4. Change $webserver_root ="/var/www/openemr"; to $webserver_root = "C:\\Program Files\\xampp\\htdocs\\openemr";

  5. At line 17, change the $web_root to $web_root = "/openemr";

  6. Next, OpenEMR expects Magic_quotes to be turned off. Again, edit C:\Program Files\xampp\apache\bin\php.ini with your Wordpad or any text editor.
    About ½ way down I located and changed
    Magic_quotes_gpc = On
    to
    Magic_quotes_gpc = Off

  7. Start Web browser and type in http: //localhost/openemr/setup.php.

  8. Click "Continue" button.

  9. For the first step, choose "Have setup create the databases" and click "Continue."

  10. For the next step, choose the following entries:

  • mysql root password – by default, XAMPP did not set any password for your mySQL,

  • openemr password – use something simple like "openemr1";

  • database name – for example, use "openemr";

  • change default clinic name to the name of your clinic – for example, use “clinic”
Click “Continue” and soon you will be seeing the message, "Congratulations..."

Perform post-installation setup.

You should get this page:

The URL address should be http://localhost/openemr/interface/login/login_frame.php. The default login name for OpenEMR is 'admin' and password would be 'pass'.

After successful installation, you need to read the user manual to get use to the application. Get the use manual here.

A matter of security (A MUST READ!)

As mentioned before, XAMPP is not meant for production use but only for developers in a development environment. The way XAMPP is configured is to be open as possible and allowing the developer anything he/she wants. For development environments this is great but in a production environment it could be fatal. Here a list of missing security in XAMPP:

  • The MySQL administrator (root) has no password.
  • The MySQL daemon is accessible via network.
  • phpMyAdmin is accessible via network.
  • Examples are accessible via network.
To get your XAMPP secured, just click on 'Security' on the sidebar when you are in the http://localhost/xampp/ page. Just follow the instructions.

That's it for now. If your trial is not successful, OR would like to participate in the discussion, OR queries OR giving any suggestion, I appreciate that you can register and voice you heart out in OpenEMR forum.