Create custom values ​​in php.ini

I would like to put some of my application configuration data in php.ini.
I tried just adding new values ​​and then getting them using ini_get
I don't show anything. Do I need to define new entries in the extension?
I know that I can create a config / ini file and parse it easily with PHP, but I want to avoid this. I do this because I assume that it loads once per process.
I don’t attach a big big picture here, since I want to keep the technical question as much as possible, unfortunately, this platform does not allow discussion. I need this inside php.ini

+5
source share
2 answers

Have you looked at get_cfg_var( config_var )?

http://www.php.net/manual/en/function.get-cfg-var.php

I believe this is for getting custom variables, for example. php.ini server file

+5
source

Do not use php.ini to configure your application, this is not the place (as the name says, it is intended to configure php, and not for any application that uses it).

If you want to use ini files for your application configuration, see parse_ini_file ()

0
source

All Articles