Subversion Repositories cheapmusic

Rev

Blame | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>Chapter 1. PHPlot Installation</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="part1.html" title="Part I. PHPlot Programming" /><link rel="prev" href="part1.html" title="Part I. PHPlot Programming" /><link rel="next" href="install-install.html" title="1.2. Installing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. PHPlot Installation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="part1.html">Prev</a> </td><th width="60%" align="center">Part I. PHPlot Programming</th><td width="20%" align="right"> <a accesskey="n" href="install-install.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="install"></a>Chapter 1. PHPlot Installation</h2></div></div></div><div class="abstract"><p class="title"><strong></strong></p><p>
This chapter explains how to install PHPlot.
  </p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="install-prereq"></a>1.1. Prerequisites</h2></div></div></div><p>
Before you can use PHPlot, you need a recent version of PHP with the GD
extension.
PHPlot-5.8.0 and later require at least PHP-5.3.
(See the README and NEWS files included with the PHPlot distribution
for requirements of other versions.)
In general, you should always use the latest available stable version of PHP.
</p><p>
If you want to display PHPlot charts on a web site, you need a PHP-enabled
web server. You can also use PHPlot with the PHP CLI (command line interface)
without a web server.
</p><p>
You need the GD extension to PHP, either built in to PHP or loaded as a
module.
The GD extension to PHP is included with PHP source releases, and is also
included in the binary Windows releases (as a loadable module).
The PHP GD extension uses the GD library (libgd).
A version of the GD library is included with PHP releases, and use of this
version is recommended, but you can also use the PHP GD extension with a
separate GD library (for example, one included with your operating system).
</p><p>
If you aren't sure what extensions you have in PHP, create this PHP
script called <code class="filename">phpinfo.php</code> somewhere in
your web server's document tree:
</p><pre class="programlisting">&lt;?php phpinfo();
</pre><p>
Access this page with your browser to view your PHP configuration.
Look for the section labeled 'gd'. If you have no 'gd' section in the
PHP Info output, you don't have the required 'gd' extension.
(The extension is either missing, or the module was not loaded.)
Consult the PHP documentation to find out how to get it loaded.
Here's what the GD section of the PHP Info listing might look like:
</p><div class="informalfigure"><div class="mediaobject"><img src="images/gdinfo.png" alt="GD section of PHP Info listing" /></div></div><p>
</p><p>
The text in the 'gd' section of the PHP Info output will tell you what
version of GD you have (you need 2.0 or higher), and what output formats it
supports.
Check the table for <span class="emphasis"><em>PNG Support</em></span>,
since PNG is the default output format for PHPlot.
If you want to create GIF or JPEG (JPG) format images,
check the table to see if they are available.
If the image formats you want are not available, you will have to rebuild PHP
(or rebuild the GD extension).
</p><p>
Another thing to look for in the 'gd' section of the PHP Info output is
<span class="emphasis"><em>FreeType Support</em></span>. If you have it enabled, you can use
TrueType fonts in PHPlot. If your GD does not have FreeType support
enabled, you can still make decent-looking plots with PHPlot, using the
built-in GD fonts. Note that even if you have FreeType Support enabled,
you need some actual TrueType font files in order to use TrueType fonts
with PHPlot.  PHPlot does not include any TrueType font files.
</p><p>
While you have the PHP Info report up, look in the Configuration section
for PHP Core, at the top of the report, and make a note of the
<code class="literal">include_path</code> setting.
If you have a local include directory in this path, you can use it for
installing PHPlot, as described below.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Don't leave the <code class="filename">phpinfo.php</code> file in your web server
document tree, as there may be security implications in the information it
tells people about your web server.
  </p></div><p>
Once you have a web server with PHP and the GD extension, you are ready to
install PHPlot.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="part1.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="part1.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="install-install.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part I. PHPlot Programming </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 1.2. Installing</td></tr></table></div></body></html>