how to allow custom built "Scan this dir for additional .ini files" php.ini file to read
Asked Answered
P

3

11

I am trying to install magento, here I came up with renaming a file name php.ini.sample to php5.ini. When I checked whether the file is reading or not I created a info.php file and uploaded to the server. Now the information shows as below:

Configuration File (php.ini) Path   /etc/php54.ini.d/
Loaded Configuration File   /etc/php54.ini.d/php.ini
Scan this dir for additional .ini files /etc/php54.d

etc/php54 is a server ini file. My file resides in the home/public file. The Scan this dir for additional .ini files dosent scan my php5.ini file I created and uploaded on the server. I am on a shared hosting plan 123-reg.co.uk. How do I turn things around here?

Passifloraceous answered 25/5, 2015 at 22:37 Comment(0)
T
10

You cannot. The directory will be set during compilation (--with-config-file-scan-dir option). See http://php.net/manual/en/function.php-ini-scanned-files.php for more information.

Try to use .user.ini files (http://php.net/manual/en/configuration.file.per-user.php) or php_value and php_admin_value with .htaccess.

But remember: You cannot change everything, see http://php.net/manual/en/configuration.changes.php for details.

Tatiania answered 9/11, 2015 at 21:34 Comment(0)
Z
7

One can append his own inis by using

SetEnv PHP_INI_SCAN_DIR /path1/php.d/:/path2/

in virtual host at least for PHP 7.2

Zarzuela answered 26/11, 2018 at 13:14 Comment(1)
For FastCGI the following works for me: FcgidInitialEnv PHP_INI_SCAN_DIR /path1/php.d/:/path2/Annadiana
H
1

Another approach, Apache/php will in my case by default scan this dir too for ini /etc/php/7.3/apache2/conf.d , just symlink you custom php.ini file from where it is such as webroot, to this conf.d folder and restart apache

Halfprice answered 16/6, 2020 at 0:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.