Re: [PHP] Ini files for CLI only on non Win32 platform

[email protected] (Kevin Kinsey)
Newsgroups php.general
Message-ID <[email protected]>
Date: Fri, 13 Sep 2013 11:40:27 +0100
From: Richard Quadling <[email protected]>
To: PHP General list <[email protected]>
Subject: [PHP] Ini files for CLI only on non Win32 platform.

>I've got an instance of PHP that is looking for additional ini files in
>/etc/php.d
>
>This seems to work well.
>
>I now need to make one of the ini files only accessible if the SAPI is CGI.
>
>So, I renamed the file ... mv /etc/php.d/my.ini /etc/php.d/my-cgi.ini
>
>If I do a ...
>
>php --ini
>
>I still see the ini file.
>
>Is the -SAPI filtering performed on the additional files?
>
>It doesn't seem to and I can't really tell from the dox if it is supposed
>to.

Shouldn't the file name be "php-cgi.ini" ?

Manual: "If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example, php-cli.ini or 
php-apache.ini), it is used instead of php.ini. The SAPI name can be determined with php_sapi_name()."

I'm in CLI mode here; note that "my-cli.ini" is ignored but "php-cli.ini"
is not:

[1016] Fri 13.Sep.2013 13:52:05
[kadmin@freebsd-devel][/www/data/]
php --ini

Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File:         /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      /usr/local/etc/php/extensions.ini

[1017] Fri 13.Sep.2013 13:52:08
[kadmin@freebsd-devel][/www/data/]                                                                   
sudo touch /usr/local/etc/php-cgi.ini

[1018] Fri 13.Sep.2013 13:52:26
[kadmin@freebsd-devel][/www/data/]
sudo touch /usr/local/etc/php-cli.ini

[1019] Fri 13.Sep.2013 13:52:32
[kadmin@freebsd-devel][/www/data/]
sudo touch /usr/local/etc/my-cli.ini

[1020] Fri 13.Sep.2013 13:52:44
[kadmin@freebsd-devel][/www/data/]
php --ini

Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File:         /usr/local/etc/php-cli.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      /usr/local/etc/php/extensions.ini


I apologize if I'm missing the point or am obtuse or irrelevant;
I don't play with the INI files very often.

Kevin Kinsey
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.