Install PHP Module for Specific PHP Version

I recently encountered a scenario where I have to install a specific PHP Module for a specific version of PHP.

To install a PHP module specifically for version x.x.x (e.g. 7.1.11) on your Ubuntu server, follow these steps:

  1. First, check the available PHP modules for version x.x.x. Run the following command to list the installed PHP modules for PHP x.x: sudo apt list --installed | grep php{x.x}
  2. Identify the specific PHP module you want to install. Let’s say the module is “php{x.x}-mymodulewithout the “{” or “}”.
  3. Install the module using the following command: sudo apt-get install php{x.x}-mymodule This will install the module only for PHP x.x.x and won’t affect other PHP versions.

Remember to replace “mymodule” with the actual name of the PHP module you want to install. Hopefully that gets you rollin!

Leave a Comment

Your email address will not be published. Required fields are marked *