Documentation

Doc index page

Enabling PHP extensions

Some of the most advanced analysis rules applied by SensioLabsInsight require to run your application. For that reason, if your project depends upon some PHP extensions to work, you need to enable them manually before analyzing your project:

1 Click on the Edit project link at the top right of a project or analysis page.

2 Enable the PHP extensions in the Configuration option using the php_ini configuration setting. You can use the following sample configuration as reference:

1
2
3
php_ini: |
    extension=mcrypt.so
    extension=openssl.so

The following PHP extensions are natively supported by SensioLabsInsight:

1
2
apcu, bcmath, bz2, curl, gd, gettext, gmp, iconv, intl, mbstring, mcrypt,
mysql, openssl, pcntl, pdo_mysql, readline, soap, xsl, zip, zlib

3 Click on the Update button and the changes will take effect in the next analysis.

Example: analyze a project that uses MongoDB

Follow these steps to enable MongoDB for every project that requires it:

1 Click on the Edit project link at the top right of a project or analysis page.

2 Install the MongoDB PHP extension and enable it by adding the following custom configuration:

1
2
3
4
5
pre_composer_script: |
    yes '' | pecl install mongo

php_ini: |
    extension=mongo.so

3 Click on the Update button and the changes will take effect in the next analysis.

Installing and enabling PECL extensions

If your project needs any other PHP extension available at PECL you can install them using the pre_composer_script configuration option. The following example shows how to download, install and enable the proctitle-alpha extension:

1
2
3
4
5
pre_composer_script: |
    pecl install proctitle-alpha

php_ini: |
    extension=proctitle-alpha.so

If the PHP extension installation asks questions, you can easily keep the default values by using the yes '' command:

1
2
3
4
5
pre_composer_script: |
    yes '' | pecl install apcu

php_ini: |
    extension=apcu.so