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 pecl.php.net:
=======================================
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

link|improve this question

feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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