Chapter 3. The Long Version: Installing the Library

Table of Contents

3.1. Downloading the library
3.2. Necessary system requirements for the library
3.2.1. Verifying the PHP/GD installation
3.2.2. Enabling GD library in php.ini for PH5
3.2.3. Verifying TTF fonts
3.2.4. Support for different image formats
3.3. Installing the library
3.3.1. Configuring JpGraph/PHP on a development server
3.3.2. Configuring JpGraph/PHP on a production server
3.3.3. Adjusting PHP include path
3.3.4. Using Apache2 alias configuration during development
3.4. Installing and configuring Font support
3.4.1. Configuring TTF fonts
3.4.2. Using non-latin based fonts with JpGraph
3.5. Adapting and customizing the installation
3.5.1. Setting up necessary paths
3.6. Verifying the library installation
3.7. Troubleshooting the installation

What you will learn in this chapter. You will learn in detail how to configure and setup an environment to be able to run the JpGraph library. The chapter will explain all configuration necessary in great details and will also list some more extensive trouble shooting steps if you encounter problems trying to get the library running. The only assumption is that you have a working PHP installation together with your HTTP server.

3.1. Downloading the library

Downloading the free version

Point the browser to "" and select the 3.x series if your are running PHP5 and the 1.x series if you are still running a PHP4 installation.


The 1.x series of the library is no longer maintained so in case you have not yet upgraded top PHP5 you should strongly consider this.

Downloading the pro version

  1. Locate your license file that was sent to you when you purchased the library. You will need both the license number as well as the registered license mail as stated in the license. Your license information should look similar to:

    : Your license key : JPGP-0920-1234657  
    :  Name on license : A. JpGraph User 
    :           E-mail :

  2. Point the browser to and enter your licence email and key on the website.

    Figure 3.1. Pro-login dialogue on JpGraph Website

    Pro-login dialogue on JpGraph Website

  3. Depending on your system you should now download either the 1.x or the (preferred) 3.x series. There is a choice to either download the library as a "*.zip" file or as a compressed "*.tar.gz" file (which is the preferred format in a Unix environment). Save the downloaded file to a temporary directory of your choice.

  4. [Optional] Verify your downloaded file against the given MD5 sum on the website. On a Unix system this can be done by running the md5 program and give the downloaded library as the argument.

    For example: $> md5 jprgaph-3.0.0p.tar.gz

  5. Unpack the library to a suitable directory that is in your PHP include path as is described in Section 3.3