GoAdmio

extension

List, install, or remove a PHP extension across every installed PHP version

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/extension manages PHP extensions server-wide. It can:

This always acts on every PHP version installed on the server, not on a single domain's version. For which version a domain uses, see multiphp.

The call is appended to /var/log/go/extension.log.


Quick start

# See what's available
/go/extension

# Install an extension everywhere
/go/extension imagick

# Remove it everywhere
/go/extension imagick remove

Syntax

/go/extension
/go/extension <name>
/go/extension <name> <action>
Form Behavior
/go/extension Lists available extensions as a table, and refreshes the cached list in GoAdmio's database.
/go/extension <name> Installs <name> for every installed PHP version.
/go/extension <name> <action> <action> of 0, 2, or remove removes it; anything else installs it.

<name> is the bare extension name as your repositories name it (for example gd, imagick, redis), not the full package name.


Options

Argument Notes
<name> Required to install or remove. Not validated; an unknown name just fails per PHP version with the package manager's own error.
<action> 0, 2, or remove → remove. Anything else, including nothing → install.

Output

No arguments

A table:

Number  Module    Description
------  ------    -----------
1       curl      PHP module for curl
2       gd        A module for PHP applications that use GD...
...

The Number column is informational only; you install or remove by name, not by number.

With a name

The output of dnf or apt for each PHP version, repeated once per version. If another extension run started in the last 10 minutes, it prints Another instance is running and exits instead.


Examples

# List what's available (also refreshes the cached list)
/go/extension
# Install imagick for every PHP version
/go/extension imagick
# Remove it again
/go/extension imagick remove
/go/extension imagick 0
# Check what actually got installed for PHP 8.3
php8.3 -m | grep imagick

Troubleshooting

Symptom Likely cause Fix
Another instance is running A run in the last 10 minutes left the lock at /usr/local/goadmio/db/lock.db. Wait, or delete the file if you're sure nothing is running.
No match for argument: php-<name> (or similar) for one or more versions The extension doesn't exist under that name for that PHP version, or the name was mistyped. Check the name in the list from /go/extension with no arguments.
The extension installs for some PHP versions but not others Different PHP versions can have different extensions available in the repositories. Check the package manager's output for each version.
Nothing seems to change after installing PHP-FPM reloads about a minute later, not immediately. Wait, or run fpm yourself.
The list is empty or missing extensions you expect The list is built from a repository search for the newest installed PHP version; other versions' repositories may differ, and the search can miss or include unrelated packages. Check your repositories directly with dnf search or apt-cache search.
An extension you know exists isn't in the list Any package name containing a hyphen is filtered out of the list (meant to hide -devel/debug sub-packages), which can also hide a legitimately hyphenated name. Install it by name anyway; the filter only affects the listing, not installation.

Details

Listing (no arguments)

  1. Clears the cached Extension table.
  2. Finds the newest installed PHP version with listphp, then searches the repositories for packages named after it (php83-* style on the RHEL family, php8.3-* on Debian and Ubuntu).
  3. Keeps only results without a hyphen in the extension name (filtering out -devel, -common, and similar sub-packages), saves each to the Extension table with a hardcoded "required" flag for a short list of common extensions, and prints the table.

This is a repository search, not an exact package listing, so unrelated packages that happen to match can appear, and the exact set depends on what your repositories currently offer for that one PHP version.

Installing or removing

For the name you give, the command:

  1. Installs or removes the unversioned php-<name> package (RHEL family) or php-<name> (Debian/Ubuntu) — whichever PHP the system treats as default.
  2. Loops over every version folder under /etc/opt/remi (RHEL family: <version>-php-<name>) or /etc/php (Debian/Ubuntu: php<version>-<name>), installing or removing the same extension for each.
  3. Schedules a PHP-FPM reload about a minute later, unless one is already scheduled.

A lock file at /usr/local/goadmio/db/lock.db blocks a second run for 10 minutes, to avoid two installs colliding.

Known issues


See also

Command Description
listphp List the available PHP versions on a GoAdmio server
multiphp Manage PHP versions per domain
installphp Install a different PHP version on GoAdmio
removephp Remove a PHP version from a GoAdmio server
fpm Restart all installed PHP-FPM versions on your server
defaultphp Change the default PHP version in the CLI