What's new
Panelica Community Forum

Welcome to the official Panelica Community Forum — the central hub for server administrators, developers, and hosting professionals. Register a free account today to access technical discussions, product announcements, feature requests, and direct support from the Panelica team. Be part of the growing community shaping the future of server management.

How to Install PHP Extensions in Panelica (Complete Guide)

admin

Administrator
Staff member
How to Install PHP Extensions in Panelica

Panelica ships with the most commonly used PHP extensions already compiled and ready to use. For most users, everything you need is already there — just enable it from the panel.

This guide covers:
  • How to check what's already available
  • How to enable or disable an extension
  • How to install a new extension that isn't pre-compiled



Where Everything Lives

All PHP versions are installed under a single, isolated directory:

Code:
/opt/panelica/services/php/
├── 8.1/
├── 8.2/
├── 8.3/
├── 8.4/
└── 8.5/

Inside each version, the structure is the same:

Code:
/opt/panelica/services/php/8.4/
├── bin/           → php, phpize, php-config, pecl
├── etc/
│   ├── php.ini
│   └── conf.d/    → extension .ini files (this is where you enable/disable)
└── lib/php/extensions/
    └── no-debug-non-zts-*/    → compiled .so files live here

That's it. Every version follows this exact layout. Replace 8.4 with whichever version you're working with.



Step 1: Check What's Already Available

Before installing anything, check what's already compiled. Most popular extensions are pre-built:

Code:
ls /opt/panelica/services/php/8.4/lib/php/extensions/no-debug-non-zts-*/

You'll see files like redis.so, mongodb.so, apcu.so, imagick.so, etc.

To see what's currently loaded:

Code:
/opt/panelica/services/php/8.4/bin/php -m

If the .so file exists but doesn't show up in php -m, it just needs to be enabled.



Step 2: Enable a Pre-compiled Extension

If the .so file already exists, enabling it is one line:

Code:
echo "extension=redis" > /opt/panelica/services/php/8.4/etc/conf.d/20-redis.ini

Then restart PHP-FPM:

Code:
pn-service restart php-8.4

Done. Verify:

Code:
/opt/panelica/services/php/8.4/bin/php -m | grep redis

To disable it, just remove the .ini file:

Code:
rm /opt/panelica/services/php/8.4/etc/conf.d/20-redis.ini
pn-service restart php-8.4

Tip: You can also enable and disable extensions from the Panelica panel UI under PHP Management → Extensions — no SSH needed.



Step 3: Install a New Extension (PECL)

If the extension you need isn't already compiled, you can install it with one command using PECL:

Code:
/opt/panelica/services/php/8.4/bin/pecl install redis

PECL handles downloading, compiling, and installing automatically. After it finishes, enable it:

Code:
echo "extension=redis" > /opt/panelica/services/php/8.4/etc/conf.d/20-redis.ini
pn-service restart php-8.4

That's the entire process: pecl install → create .ini → restart.

What if PECL asks questions during install?

Some extensions ask configuration questions. You can skip them all with defaults:

Code:
echo "" | /opt/panelica/services/php/8.4/bin/pecl install redis

What if it fails?

PECL compiles from source, so it may need system libraries. The error message will tell you what's missing. Common examples:

Code:
# For imagick
apt-get install libmagickwand-dev

# For imap
apt-get install libc-client-dev libkrb5-dev

# For grpc
apt-get install zlib1g-dev

Install the missing library, then run pecl install again.



Pre-compiled Extensions by Version

Here's what ships ready to use. If it's listed below, you don't need to install anything — just enable it.

PHP 8.2 / 8.4 — Largest selection (~55 extensions)
apcu, bcmath, bz2, curl, dom, gd, igbinary, imap, intl, ldap, mbstring, mongodb, mysqli, odbc, opcache, pdo_mysql, pdo_pgsql, pgsql, redis, soap, swoole, xdebug, xsl, zip, and many more.

PHP 8.3 — Most standard extensions are built-in, PECL extensions available as .so:
apcu, igbinary, imagick, imap, mongodb, redis, swoole, xdebug, grpc

PHP 8.5 (RC) — Development version, essential PECL extensions:
apcu, igbinary, imagick, mongodb, redis, xdebug

PHP 8.1 — End of life. Most extensions are built into the binary. Only opcache as shared .so. Consider upgrading to 8.2+.



Quick Reference

Code:
# List available .so files for any version
ls /opt/panelica/services/php/{VERSION}/lib/php/extensions/no-debug-non-zts-*/

# List loaded modules
/opt/panelica/services/php/{VERSION}/bin/php -m

# Install via PECL
/opt/panelica/services/php/{VERSION}/bin/pecl install {EXTENSION}

# Enable
echo "extension={EXTENSION}" > /opt/panelica/services/php/{VERSION}/etc/conf.d/20-{EXTENSION}.ini

# Restart PHP-FPM
pn-service restart php-{VERSION}

# Disable
rm /opt/panelica/services/php/{VERSION}/etc/conf.d/20-{EXTENSION}.ini
pn-service restart php-{VERSION}

Replace {VERSION} with your PHP version (8.2, 8.3, 8.4, etc.) and {EXTENSION} with the extension name.



Notes

  • Extensions compiled for one PHP version will not work on another. Each version has its own directory and its own compiled .so files.
  • The Panelica panel UI can toggle pre-compiled extensions without SSH. For extensions that aren't pre-compiled, use pecl install via SSH.
  • After any manual changes, you can run /opt/panelica/scripts/php/sync_extensions.sh to auto-detect and sync all extensions.
  • Zend extensions (opcache, xdebug) use zend_extension= instead of extension= in the .ini file, and are named with prefix 10- instead of 20-.

Questions? Reply below and we'll help you get it working.
 
Last edited:
Back
Top