The Note You're Voting On
atv dot seth at gmail dot com ¶6 months ago
For anyone who wants to ignore any directory entirely
On a linux Redhat distro (this was on EL9):
; if using php-fpm, put this file in place"
/etc/systemd/system/php-fpm.service.d/override.conf
[Service]
Environment="PHP_INI_SCAN_DIR="
; do a systemd config reload:
systemctl daemon-reload
; if you want to make sure php on the cli fails if it's not passing 'PHP_INI_SCAN_DIR= php' (this should also affect both linux normal+system users?) then drop this file in place:
cat /etc/php.d/00-dont-use-phpd.ini
auto_prepend_file=MISSING_ENV__PHP_INI_SCAN_DIR__SEE_ETC_PHPD_00_DONT_USE_PHPD_INI
; don't allow php.d directory to load in files
; you must pass 'PHP_INI_SCAN_DIR= ' before your php command on the cli
; reference:
; https://www.php.net/manual/en/configuration.file.php#configuration.file.scan