php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22011 php -n does not work as expected
Submitted: 2003-02-02 08:13 UTC Modified: 2003-02-03 06:26 UTC
From: holliwell at gmx dot net Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.3.0 OS: linux RH 8.0
Private report: No CVE-ID: None
 [2003-02-02 08:13 UTC] holliwell at gmx dot net
Hi,

if php CLI was configured:
--with-config-file-path=/etc
--with-config-file-scan-dir=/some/directory
-n switch passed to the CLI scans this additional ini file(s).

php -h says
-n No php.ini file will be used

Does this "No" exclude additional ini-files?


PHP 4.3.0 (cli)

PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => no
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, https, ftps, compress.zlib

Regards
Friedhelm Betz

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-02 18:51 UTC] helly@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Please ask such questions on php-general@lists.php.net.
 [2003-02-02 19:07 UTC] holliwell at gmx dot net
This switch is not documented so far and if this is not a bug but expected behaviour let it be at least a doc problem;-)
Regards
Friedhelm Betz
 [2003-02-03 05:12 UTC] edink@php.net
-n switch should also ignore ini files defined --with-config-file-scan-dir. Re-opening.
 [2003-02-03 05:59 UTC] holliwell at gmx dot net
To clarify my first submission:
-n switch passed to the CLI scans this additional ini file(s) and uses the values found inside.

easy to reproduce:
let config-file-path be /etc
let config-file-scan-dir be /opt/php
origin /etc/php.ini sets register_globals off
/opt/php/php.ini sets register_globals on

php -n -r  'echo  ini_get('register_globals') . "\n";'
php -r  'echo  ini_get('register_globals') . "\n";'

yields the same results, shown that additional ini files are scanned, parsed and applied.
Therefore it seems that -n has the only effect, that the php.ini in config-file-path is ignored, but additional ini-files are parsed and their values applied.

Again: is this expected behaviour?

Regards
Friedhelm Betz
 [2003-02-03 06:04 UTC] holliwell at gmx dot net
reopening as closed by accident
 [2003-02-03 06:26 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


Now -n will ignore all ini files.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 02:01:29 2024 UTC