LinuxCommandLibrary

phpenmod

enables PHP extensions on Debian-based systems by creating symbolic

TLDR

Enable extension for all PHP versions and SAPIs

$ sudo phpenmod [extension]
copy
Enable extension for specific version and SAPI
$ sudo phpenmod -v [7.4] -s [cli] [extension]
copy

SYNOPSIS

phpenmod [-v version] [-s sapi] module

DESCRIPTION

phpenmod enables PHP extensions on Debian-based systems by creating symbolic links in the conf.d directory pointing to module configuration files. Without version or SAPI specified, it enables the extension for all installed PHP versions and all SAPIs.
The command creates symlinks in /etc/php/VERSION/SAPI/conf.d/ that point to module configuration files in mods-available.

PARAMETERS

-v _version_

PHP version (e.g., 7.4, 8.0, 8.1)
-s _sapi_
SAPI type (cli, fpm, apache2, cgi)
module
Extension name to enable

CAVEATS

Debian/Ubuntu specific tool. Requires root privileges. Changes take effect after restarting PHP-FPM or Apache. Extension must be installed before it can be enabled.

HISTORY

phpenmod is part of the php-defaults package maintained by the Debian PHP team. It provides a standardized way to manage PHP extensions, similar to how a2enmod/a2dismod manage Apache modules.

SEE ALSO

phpdismod(8), phpquery(8), php(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community