PHP Extensions
PHP application servers on the platform have many built-in modules. This enables you to configure distinct PHP extensions for the PHP-FPM (NGINX-PHP) and httpd (Apache-PHP) daemons. Several frequently used extensions come pre-installed and are by default operated by PHP:
ctype | hash | |
date | libxml | session |
dom | mhash | SLPxml |
ereg | pcre | sockets |
filter | Reflection |
The Remaining extensions are dynamic, which means that they are part of the server builds (kept in a separate modules folder) and can be enabled when required:
apc.so | inotify.so | pdo_firebird.so | |
apcu.so | intl.so | pdo_mysql.so | sphinx.so |
bcmath.so | json.so | pdo_oci.so | sqlite3.so |
bz2.so | ldap.so | pdo_odbc.so | svn.so |
calendar.so | mbstring.so | pdo_pgsql.so | sysvmsg.so |
curl.so | mcrypt.so | pdo_sqlite.so | sysvsem.so |
dba.so | memcache.so | pdo.so | sysvshm.so |
dom.so | memcached_2_1_0.so | pgsql.so | tidy.so |
enchant.so | memcached_2_2_0.so | phar.so | timezonedb.so |
event.so | mongo.so | posix.so | tokenizer.so |
exif.so | mongodb.so | propro.so | uuid.so |
fileinfo.so | mysql.so | pspell.so | wddx.so |
ftp.so | mysqli.so | raphf.so | xcache.so |
gd.so | mysqlnd_ms.so | rar.so | xdebug.so |
gearman.so | mysqlnd_qc.so | readline.so | xmlreader.so |
geoip.so | mysqlnd.so | recode.so | xmlrpc.so |
gettext.so | ncurses.so | so | xmlwriter.so |
gmp.so | oauth.so | shmop.so | xsl.so |
http.so | odbc.so | simplexml.so | yaml.so |
iconv.so | opcache.so | snmp.so | ZendGuardLoader.so |
igbinary.so | openssl.so | soap.so | zip.so |
imagick.so | pcntl.so | solr.so | zlib.so |
imap.so | pdo_dblib.so | solr2.so |
Below, You Can Learn How To
1. Activate Extension
To make a dynamic extension available for the PHP module (i.e., engine) you’re using, it needs to be enabled in the corresponding configuration file.
Here’s how you can enable a dynamic extension for the PHP module:
Step 1. Click the “Config” button for your app server.
Step 2. Locate the `etc > php.ini` file in the configuration tab that is opened, then scroll down to the “Extensions provided by PaaS” section. This section contains a subsection for each dynamic extension where you can enable and configure it.
Step 3. Now, find the necessary section (they are arranged alphabetically) and remove the {extension={module_name} comment. To enable the so{ directive, remove the semicolons at the beginning of the appropriate line:
You can also modify the extension by adding your configuration parameters or by using the ones that are already supplied.
Step 4. After making all the necessary changes, remember to save them and restart the node to apply the new configuration.
2. Configure Extension
The `php.ini` file manages all of the required PHP module settings. The majority of the offered dynamic extensions have a list of potential setup options.
As an example, here are some settings for the dynamic OPcache extension, a PHP accelerator based on opcode caching and optimization:
- `opcache.enable=1` – Enable or disable the OPcache extension
- `opcache.memory_consumption=64` – Set the amount of memory to use
- `opcache.interned_strings_buffer=8` – Set the amount of memory for storing internal strings (e.g., class names)
- `opcache.max_accelerated_files=4000` – The maximum number of files to be cached
- `opcache.revalidate_freq=60` – The frequency of checking file timestamps for shared memory storage allocation changes
- `opcache.fast_shutdown=1` – Enable or disable a fast shutdown sequence for accelerated code
- `opcache.enable_cli=1` – Enable or disable OPcache for the CLI version of PHP
3. Add Custom Extension
In addition to all the modules available out-of-the-box on the platform, you can integrate your PHP extensions if needed. Just follow the instructions below:
Step 1. Compile the extension itself.
Step 2. Navigate to the platform dashboard and click the “Config” button for your PHP application server.
Step 3. Now, using the opened manager, upload your custom extension to the modules folder.
Step 4. Navigate to the `etc > php.ini` file, find the Dynamic Extensions section, and add the following command directive:
extension={module_name}.so
Step 5. Save the changes and restart the node.
That’s it! Now your custom extension is activated.