University at Buffalo - The State University of New York
Skip to Content

Step-by-Step Instructions

How to Add PHP Libraries to a Pod

Learn how to add non-standard PHP extensions to your pod.  Most extensions can be installed without additional configurations.  However, some extensions (e.g. oci8) require additional libraries be installed and configured. 

Operating System: Any

Applies To: Faculty or Staff using WebApps

Last Reviewed: July 18, 2017

What is a Library?

 

A library is a collection of PHP classes (native PHP code) which solve generic tasks such as building HTML forms and sending emails. PHP libraries are usually fairly easy to install and use. Examples of PHP libraries include:

  • phpseclib

  • pchart
  • recaptcha
  • ratchet
  • mink


 

Prerequisites

Instructions

1. Add a composer.json file to your repository using the following structure.  You will need to replace the items enclosed in "< >" with the appropriate values.

composer.json

1.

2.

3.

4.

5.

6.

7.

{

    "require": {

        "<first_library_name>": "<version_requirements>",

        "<second_library_name>": "<version_requirements>",

        "<third_library_name>": "<version_requirements>"

    }

}

Example composer.json File

The following composer.json file will cause your pod to install any 2.x version of the phpseclib library:

{

    "require": {

        "phpseclib/phpseclib": "2.*"

    }

}

See also

Contact the UBIT Help Center

Have a UBITName? You may also use the UBIT Help Center Online (login required).

(Required)
 
 
(xxx) xxx-xxxx
(Required)
Use your @buffalo.edu email, if known
 
(Required)