ch02.html 7.24 KB
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 2. The Short Version: Installing the library (for PHP/Apache experts)</title><link rel="stylesheet" type="text/css" href="manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.0"><link rel="home" href="index.html" title="JpGraph Manual"><link rel="up" href="pt01.html" title="Part I. Installing and verifying the configuring"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. The Short Version: Installing the library (for PHP/Apache experts)</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center">Part I. Installing and verifying the configuring</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter" title="Chapter 2. The Short Version: Installing the library (for PHP/Apache experts)"><div class="titlepage"><div><div><h2 class="title"><a name="id2475446"></a>Chapter 2. The Short Version: Installing the library (for PHP/Apache experts)</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch02.html#id2475509">2.1. Installing</a></span></dt><dt><span class="sect1"><a href="ch02s02.html">2.2. Running the examples</a></span></dt><dt><span class="sect1"><a href="ch02s03.html">2.3. Basic trouble shooting</a></span></dt></dl></div>
        
        <p title="What you will learn in this chapter">
            <b>What you will learn in this chapter. </b>
            This chapter will show you how to unpack the library and lists the minimum
                prerequisites that is needed to get the library running. It is assumed that your are
                familiar with adjusting the PHP configuration file <code class="filename">php.ini</code> and
                that you already have a working PHP installation.
        </p>
        <div class="sect1" title="Installing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2475509"></a>Installing</h2></div></div></div>
            
            <p>Please follow the steps below:</p>
            <p>
                </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
                        <p>Either download the free library from <code class="uri"><a class="uri" href="http://jpgraph.net/download/" target="_top">http://jpgraph.net/download/</a></code>
                            or use your license information and download the pro-version from
                                <code class="uri">http://jpgraph.net/pro/login.php</code>. The download
                            is just a packed zip (or tar.gz) of php files. There are no automatic
                            installation scripts.</p>
                    </li><li class="listitem">
                        <p>Unpack the library where you normally store PHP libraries. This should
                            be in your PHP include path. When you unpack the library it will be
                            named "jpgraph-3.x" (where x corresponds to the version you have
                            downloaded).</p>
                    </li><li class="listitem">
                        <p>Now either rename the unpacked the directory to just jpgraph or if the
                            system us Unix based create a soft symbolic link, for example</p>
                        <p><code class="prompt">ln -s jpgraph-2.x jpgraph</code></p>
                        <p>This will allow you to access the library files in your own program
                            for with a <code class="code">require_once('jpgraph/jpgraph.php')</code></p>
                    </li><li class="listitem">
                        <p>Make sure that the GD extension is enabled in your
                                <code class="filename">php.ini</code> file (check the output from
                                <code class="code">phpinfo()</code> ) </p>
                    </li><li class="listitem">
                        <p>[Optional] Verify that the paths defined in
                                <code class="filename">jpg-config.inc.php</code> corresponds to the server
                            setup. The path to your TTF fonts must be correct. If you get an error
                            saying that some TTF fonts cannot be found or read then the path needs
                            to be adjusted in this configuration file.</p>
                    </li><li class="listitem">
                        <p>[Optional] Check that you have sufficient memory and execution time
                            set in your <code class="filename">php.ini</code> file. It is recommended to
                            allow at least 32Mb memory for PHP if you intend to run anything else
                            than very basic graph scripts.</p>
                    </li><li class="listitem">
                        <p>[Optional] To allow for better debugging in conjunction with graph
                            scripts the output buffering should also be disabled in
                                <code class="filename">php.ini</code></p>
                    </li><li class="listitem">
                        <p>[Optional] To avoid warning messages it might be necessary to set the
                            default timezone in <code class="filename">php.ini</code> if this has not already
                            been done. Starting with PHP 5.2 a warning is generated if the timezone
                            for PHP is not set.</p>
                    </li></ol></div><p>
            </p>
            <div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3>
                <p>When you install the library on a production server then you should not
                    install the library in the document root. Instead it should be installed so that
                    only the script can directly access the library files (somewhere in the PHP
                    path). </p>
                <p>If you have the pro-version you really should install the pre-compiled version
                    of the library (available under directory <code class="filename">PhpExpress-src</code>.
                    This will significantly increase the performance of the library. The only
                    prerequisite is that you also need to install the (free) PhpExpress PHP
                    Accelerator from NuSphere Corporation. See <a class="xref" href="ch11.html" title="Chapter 11. NuSphere PHP accelerator">Chapter 11. <i>NuSphere PHP accelerator</i></a> for information on how to install the
                    freely available PHP Accelerator.</p>
            </div>
        </div>
        
        
    </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>