Reading php.ini using zend to extend PHP (not PHP language)

I am trying to read some settings from php.ini using zend. The API that I use

long zend_ini_long(char *name, uint name_length, int orig)

But it always returns 0. I double-checked the name and also made sure that the value that I specify in php.ini is greater than 0. Is there something I am missing?

+3
source share
3 answers
 long maxwait = zend_ini_long("max_execution_time",
     sizeof("max_execution_time"), 0);

The problem is that ZEND_STRL does not return the correct length for the way this API is used, so do not use it.

, -, PHP, , NUL ( ), sizeof (), strlen() sizeof() - 1.

+3

php.ini? , phpinfo()?

, "www" ? , 0?

0

You can use the standard php function: ini_get ('var-name');

Example:

ini_get('include_path');
0
source

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


All Articles