开发者

create arbitrary values in php.ini

I would like to put some of my app config data in php.ini

I tried just to add new values there and then get them with ini_get

I get nothing displayed. Do I need to define new entries in an extension?

I know I can create a config file/ini file and easily parse it with PHP, But I want to avoid that. I do that as I assume it is being loaded once per开发者_StackOverflow社区 process.

I do not give here the big big picture, as I want to keep it as much as possible only a technical question, sadly, this platform does not allow debates.

I do need it inside the php.ini


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 retrieving custom variables from e.g. the servers php.ini file


Don't use php.ini to configure your application, it's not the right place (as the name says, it's intended to configure php, not any application using it).

If you want to use ini files for your application's configuration, have a look at parse_ini_file()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜