PHP parse_ini_file () - where does it look?

if I call php parse_ini_file("foo.ini"), in what ways does it look for foo.ini? inclusion path? functional documentation does not mention this.

+3
source share
3 answers

The filename argument to parse_ini_file is the default php file name, so the same rules will apply when opening a file with fopen .

You must specify the absolute path to the file ("/path/to/my.ini") or the path relative to your current working directory ("my.ini"). See getcwd for the current working directory.

fopen , ( "my.ini" ), parse_ini_file . php 5.2.6.

+6

, - . http://uk3.php.net/manual/en/function.getcwd.php, , .

, $_SERVER ['DOCUMENT_ROOT']

+1

It may depend on your configuration, but basically it is the current directory and then include_path

+1
source

Source: https://habr.com/ru/post/1697574/


All Articles