4

Is there a way to set a location for apache to read custom php.inis from? Currently it says "Scan this dir for additional .ini files" as "(none)"

The environment is CentoOS 6, Apache 2, and PHP running via DSO

Raheel Hasan
  • 5,753
  • 4
  • 39
  • 70
  • Does this answer your question? [How do I include a php.ini file in another php.ini file?](https://stackoverflow.com/questions/1391808/how-do-i-include-a-php-ini-file-in-another-php-ini-file) – Martin Zeitler Jan 26 '20 at 21:41

1 Answers1

-1

Scan directories for .ini files is configured at compiled time via --with-config-file-scan-dir option.

However for later versions of PHP from v5.2.0 you can overwrite it at run time by setting PHP_INI_SCAN_DIR environment variable.

You can employ SetEnv directive within context of a server config, virtual host, directory or .htaccess file to update this value.

SetEnv PHP_INI_SCAN_DIR /usr/local/opt/php-extras
Oluwafemi Sule
  • 36,144
  • 1
  • 56
  • 81
  • This question was 5-6 years old and duplicated at least 3 times. – Martin Zeitler Jan 26 '20 at 21:41
  • I checked the question to linked to and there are differences there. First this question appears before the others. It asks specifically about *configuring the scan directories in Apache*. You don't think both question to be same, do you? – Oluwafemi Sule Jan 26 '20 at 22:39