phpdismod
Disable specific PHP modules
TLDR
Disable the JSON extension for every SAPI of every PHP version
Disable the JSON extension for PHP 7.3 with the cli SAPI
SYNOPSIS
phpdismod [options]
PARAMETERS
The name of the PHP module to disable.
-v
Specify the PHP version to operate on (e.g., 7.4, 8.1). If omitted, the default PHP version is used.
-s
Specify the SAPI (Server API) to operate on (e.g., cli, apache2). If omitted, all SAPI configurations are modified.
-l
List the enabled modules and exit.
-q
Quiet mode. Suppress output messages.
-n
No-act mode. Show what would be done, but don't actually do anything.
-h
Display help message and exit.
DESCRIPTION
The `phpdismod` command is a utility for disabling PHP modules on a Debian or Ubuntu system. It manages symbolic links in the `/etc/php/
It simplifies the process of modifying PHP's module configuration, making it easier to manage enabled extensions across different PHP versions and SAPI (Server API) environments (e.g., CLI, Apache).
Using `phpdismod` ensures consistent module management, preventing manual manipulation of configuration files, which can be error-prone. It's especially helpful in scripting environments for automating server setup and managing PHP configurations.
The command interacts directly with the system's package manager to ensure proper module configuration, typically involving symbolic links and updates to the Apache or CLI configuration files after changes.
CAVEATS
The `phpdismod` command is specific to Debian-based systems (like Ubuntu) that use the Debian package management system and the `php-common` package. It might not be available or function correctly on other operating systems or distributions.
Incorrect use can lead to a non-functioning PHP installation. It's recommended to understand the PHP module structure before using `phpdismod`.
MODULE CONFIGURATION DIRECTORIES
PHP modules are typically configured within the `/etc/php/
IMPACT ON WEB SERVER
When disabling modules for the 'apache2' SAPI, remember to restart the Apache web server for the changes to take effect. Use `sudo systemctl restart apache2`.
HISTORY
The `phpdismod` command was developed as part of the Debian PHP packaging infrastructure to simplify the management of PHP modules. It aims to provide a consistent interface for enabling and disabling PHP modules, especially in environments where multiple PHP versions are installed. This command and the related `phpenmod` command are managed within the Debian/Ubuntu packaging system.