Include PHP Extensions on the Command Line When Running Drush
Date Published: September 27, 2023
If you have compiled a PHP extension and it is enabled on your environment, it will not be available to PHP on the command line. To make it available, you need to preface your commands by adding an additional path to scan for php.ini files. For example:
Important: Replace site.env with your application name and the environment you are running this on. This will scan the php.ini that has your extension enabled.
The alternative is to place a php.ini file in the "current directory" of where you run Drush. You'd only really be able to do this in your home directory, as nowhere else is writable. It would need to contain the following (again, replace the example parts as needed):
If you go this route, you would need to run Drush from your home directory for this to work, but you would not need to preface it with PHP_INI_SCAN_DIR (and so on).
Include PHP Extensions on the Command Line When Running Drush | Acquia Product Documentation
Cloud Platform
Include PHP Extensions on the Command Line When Running Drush