PHP Extensions

PHP Extensions

Apache, NGINX, and LiteSpeed PHP application servers include built-in and dynamic PHP extensions. Built-in extensions run by default, while dynamic extensions are stored in the stack’s modules directory and can be enabled through php.ini.

Built-In Extensions

The following commonly required extensions are loaded and run by default:

ctype
date
dom
ereg
filter
hash
libxml
mhash
pcre
Reflection
session
SLPxml
sockets
i

Stack-dependent availability

The available extensions can differ by PHP version and application-server type. Built-in extensions should not be loaded manually.

Dynamic Extensions

Apache PHP

Modules directory: /usr/lib64/php/modules

apcu.so
apfd.so
ast.so
bcmath.so
bitset.so
brotli.so
bsdiff.so
bz2.so
calendar.so
ctype.so
curl.so
dba.so
dio.so
dl_test.so
dom.so
ds.so
eio.so
enchant.so
exif.so
excimer.so
ffi.so
fileinfo.so
filter.so
ftp.so
gd.so
gearman.so
geoip.so
http.so
ice.so
iconv.so
igbinary.so
imagick.so
inotify.so
intl.so
json_post.so
jsonpath.so
mailparse.so
mbstring.so
mcrypt.so
md4c.so
memcache.so
memcached.so
mongodb.so
msgpack.so
mustache.so
oauth.so
odbc.so
openssl.so
openswoole.so
opcache.so
opentelemetry.so
operator.so
parle.so
pcntl.so
pcov.so
pcsc.so
pdo.so
pdo_dblib.so
pdo_firebird.so
pdo_mysql.so
pdo_odbc.so
pdo_pgsql.so
pdo_sqlite.so
pgsql.so
phalcon.so
phar.so
phpy.so
pinpoint_php.so
pkcs11.so
posix.so
protobuf.so
psr.so
pspell.so
quickhash.so
raphf.so
readline.so
redis.so
rpminfo.so
scoutapm.so
seaslog.so
SeasSnowflake.so
scrypt.so
selinux.so
session.so
shmop.so
simplexml.so
simdjson.so
snmp.so
soap.so
sockets.so
sodium.so
solr.so
solr2.so
sqlite3.so
stomp.so
svm.so
swoole.so
sync.so
sysvmsg.so
sysvsem.so
sysvshm.so
tidy.so
timezonedb.so
tokenizer.so
translit.so
uploadprogress.so
uuid.so
var_representation.so
vld.so
xattr.so
xdebug.so
xhprof.so
xlswriter.so
xml.so
xmldiff.so
xmlreader.so
xmlwriter.so
xpass.so
xsl.so
yaf.so
yaconf.so
yaml.so
yar.so
zephir_parser.so
zip.so
zlib.so
zookeeper.so
zstd.so

NGINX PHP

Modules directory: /usr/lib64/php/modules

apcu.so
apfd.so
ast.so
bcmath.so
bitset.so
brotli.so
bsdiff.so
bz2.so
calendar.so
crypto.so
csv.so
ctype.so
curl.so
dba.so
dio.so
dl_test.so
dom.so
ds.so
eio.so
enchant.so
event.so
ev.so
exif.so
excimer.so
ffi.so
fileinfo.so
filter.so
ftp.so
gd.so
gearman.so
gettext.so
gmp.so
http.so
ice.so
iconv.so
igbinary.so
imagick.so
inotify.so
intl.so
json_post.so
jsonpath.so
lzf.so
ldap.so
mailparse.so
mbstring.so
mcrypt.so
md4c.so
memcache.so
memcached.so
mongodb.so
msgpack.so
msqli.so
mssql.so
mustache.so
mysqlnd.so
mysqli.so
oauth.so
odbc.so
openssl.so
openswoole.so
opcache.so
opentelemetry.so
operator.so
parallel.so
parle.so
pcntl.so
pcov.so
pcsc.so
pdo.so
pdo_dblib.so
pdo_firebird.so
pdo_mysql.so
pdo_odbc.so
pdo_pgsql.so
pdo_sqlite.so
pdo_sqlsrv.so
pgsql.so
phalcon.so
phar.so
phpy.so
pinpoint_php.so
pkcs11.so
posix.so
protobuf.so
psr.so
pspell.so
quickhash.so
raphf.so
readline.so
redis.so
rpminfo.so
scoutapm.so
seaslog.so
SeasSnowflake.so
scrypt.so
selinux.so
session.so
shmop.so
simplexml.so
simdjson.so
snmp.so
soap.so
sockets.so
sodium.so
solr.so
solr2.so
sqlsrv.so
stomp.so
svm.so
swoole.so
sync.so
sysvmsg.so
sysvsem.so
sysvshm.so
tidy.so
timezonedb.so
tokenizer.so
translit.so
uploadprogress.so
uuid.so
var_representation.so
vld.so
xattr.so
xdebug.so
xhprof.so
xlswriter.so
xml.so
xmldiff.so
xmlreader.so
xmlwriter.so
xpass.so
xsl.so
yaf.so
yaconf.so
yaml.so
yar.so
zephir_parser.so
zip.so
zlib.so
zookeeper.so
zstd.so

LiteSpeed PHP

Modules directory: /usr/local/lsws/lsphp/lib64/php/modules

apcu.so
bcmath.so
bz2.so
calendar.so
ctype.so
curl.so
dba.so
dom.so
enchant.so
exif.so
fileinfo.so
ftp.so
gd.so
gettext.so
gmp.so
iconv.so
igbinary.so
imagick.so
imap.so
ioncube.so
ioncube_loader.so
ioncube_ts.so
intl.so
ldap.so
mbstring.so
memcached.so
mongodb.so
msgpack.so
mysqli.so
mysqlnd.so
oauth.so
odbc.so
opcache.so
pdo.so
pdo_mysql.so
pdo_odbc.so
pdo_pgsql.so
pdo_sqlite.so
pgsql.so
phar.so
posix.so
redis.so
shmop.so
simplexml.so
snmp.so
soap.so
sockets.so
sodium.so
sqlite3.so
sysvmsg.so
sysvsem.so
sysvshm.so
tidy.so
tokenizer.so
xsl.so
xml.so
xmlreader.so
xmlrpc.so
xmlwriter.so
yaml.so
zip.so
zstd.so

Activate an Extension

1

Open Configuration Manager

Click Config beside the PHP application server.

Open PHP server configuration
Open Configuration Manager for the PHP application server.
2

Open php.ini

Navigate to etc → php.ini and scroll to the Extensions provided by PaaS section.

PHP extensions in php.ini
Each dynamic extension has a dedicated configuration subsection in php.ini.
3

Uncomment the extension directive

Find the required extension in alphabetical order and remove the semicolon before:

extension={module_name}.so
Enable a PHP extension directive
Remove the leading semicolon to activate the required extension.
4

Save and restart

Save php.ini and restart the PHP node to apply the extension.

Restart the PHP application server
Restart the PHP node after updating the extension configuration.

Configure an Extension

Extension settings are managed in php.ini. The source page uses OPcache as an example:

opcache.enable=1
opcache.memory_consumption=64
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
  • opcache.enable enables or disables OPcache.
  • opcache.memory_consumption sets the allocated memory.
  • opcache.interned_strings_buffer controls storage for internal strings.
  • opcache.max_accelerated_files defines the maximum number of cached files.
  • opcache.revalidate_freq sets the timestamp-check frequency.
  • opcache.fast_shutdown controls the fast shutdown sequence.
  • opcache.enable_cli enables or disables OPcache for PHP CLI.

Add a Custom Extension

1

Compile the extension

Compile the custom module for the same PHP version, architecture, and application-server stack used by the target node.

2

Open Configuration Manager

Click Config beside the PHP application server.

3

Upload the module

Upload the compiled extension to the stack’s modules folder.

Upload a custom PHP extension
Upload the compiled extension to the modules folder.
4

Add the extension directive

Open etc → php.ini, find the Dynamic Extensions section, and add:

extension={module_name}.so
Configure a custom PHP extension
Add the custom module directive and any required settings to php.ini.
5

Save and restart

Save the configuration and restart the node. The custom extension is then activated.

Important Notes

  • Do not manually load extensions that are already built in.
  • Module availability differs by PHP version and application-server stack.
  • Compile custom extensions for the exact PHP version and server architecture.
  • Restart the node after enabling or configuring an extension.
  • An incompatible extension can prevent PHP from starting; keep a rollback copy of php.ini.