How to install a php extension

ericovk

Verified User
Joined
Apr 17, 2012
Messages
228
Location
Rotterdam, Netherlands
I would like to install a php library called JPgraph, but have no clue where to do so. (Currently running custombuild 2.0 with php 5.5.14) Do I need to recompile php after "installation"?
 
Last edited:
Hello,

It's said on the official site:

JpGraph is an Object-Oriented Graph creating library for PHP >= 5.1 (including 5.4 and 5.5) The library is completely written in PHP and ready to be used in any PHP scripts (both CGI/APXS/CLI versions of PHP are supported).

http://jpgraph.net/doc/howto.php

So to start using it you don't need to do anything to PHP, just download the files and include into your PHP application:


1-1 Where should I install the library?

The simple answer is: Anywhere You like! Since the necessary library files are included in Your own script with an "include" statement it doesn't matter where You put the library as long as Your scripts can access it. A common place is to store the library is in a directory where PHP searches for include files (as specified in Your php.ini file), for example in "/usr/share/php" or perhaps "/usr/local/php" depending on Your PHP configuration. An even simpler way is to just store the library in a directory where Your scripts are executed from.


http://jpgraph.net/doc/faq.php#F1-1
 
Thanks, I gues I wasn't thinking clear. I was wondering if I had to recompile php, but that isn't the case. Do you ever have to recompile php when you install an extension or library?
 
Yes, sometimes we need to recompile PHP to enable this or that feature. PHP extensions if they are not shipped with PHP source do not require PHP rebuilt, PHP libtaries do not require it either.
 
Back
Top