---
title: "Include PHP Extensions on the Command Line When Running Drush"
date: "2023-09-27T17:08:17+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92271-include-php-extensions-command-line-when-running-drush"
id: "d362020c-97a3-49b9-956e-cff9117102a9"
---

If you have [compiled a PHP extension and it is enabled on your environment](/node/56165), 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:

    PHP_INI_SCAN_DIR="$PHP_INI_SCAN_DIR:/var/www/site-php/site.env/" drush php-eval "phpinfo();"

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):

    extension = /var/www/html/site.env/library/extension-path/extension-name.so

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).