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
An extension is a piece of code written in C or C++ which will be included into the PHP core when PHP starts. Normally you have some more native functions available after including a extension. PHP extensions are slightly more difficult to install than PHP libraries. Examples of PHP extensions include:
1. Add the following files to your code repository in the locations specified. Replace "<extension_name>" with the name of the extension you would like to install.
### Add any additional variables required by the extension below this line ###
### Add any prerequisite steps above this line ###
echo "Installing extension"
pecl bundle <extension_name>
echo "extension=/opt/app-root/<extension_name>/modules/<extension_name>.so" >> /opt/app-root/php.d/<extension_name>.ini
### Repeat lines 4 - 10 for any additional extensions ###
### Do not remove the line below unless you are sure you know what you are doing ###
echo "Running assemble script"
2. Follow the steps for How to create a new pod (aka container)
The repositories listed below are complete examples of how to install the extension specified. You can simply clone the repository and add your own code if you plan to use the extension in the example.