Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've copied gChartPhp into /var/www/html on my CentOS 5 Linux machine and it works ok, but I wonder if there is maybe a better way to install and maintain that code.

I'm asking this because gChartPhp contains a PEAR subdirectory. And there is already the dir called /usr/share/pear/PEAR at my machine. Maybe it is possible to install it using the php-pecl rpm package?

I've tried "pecl search chart" but it can find only the other "package":

pecl search chart
Retrieving data...0%....50%....Matched packages, channel
Package Stable/(Latest)    Local
GDChart -n/a-/(0.2.0 beta)       GDChart Based Graphing Interface

Or should I maybe copy gChartPhp manually and add it to the include_path in /etc/php.ini ?

Thank you for any insights! Alex

share|improve this question
up vote 1 down vote accepted

Its good practice to keep shared libraries in a directory referenced by the include path - that way you've got a consistent way of referencing their path. Also its a good idea to keep off-the-shelf code outside the document root (or disable PHP parsing of such files within the document root) to avoid introducing security vulnerabilities.

Without doing a lot of reverse engineering on the package its hard to say if this should be within the PEAR hierarchy - but erring on the side of caution and keeping it outside avoids any complications.

share|improve this answer
Yes thanks, I like to keep that stuff outside of document root and never give it apache/www/nobody ownership too – Alexander Farber Dec 6 '10 at 13:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.