Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get PHP master ini values

Tags:

php

In phpinfo it shows you the "Master" and "Local" values for ini settings.

I want to compare them to determine whether a setting has changed since the start of the script.

Getting the local values is easy:

<?php
$local = ini_get('setting');

But I can't find anything describing how to get the master value.

like image 440
J V Avatar asked Apr 09 '26 20:04

J V


1 Answers

I think that get_cfg_var() is what you are looking for.

To quote a comment in the manual

The difference between ini_get() and get_cfg_var() is as follows:

  • ini_get(): returns the current value in .htaccess or as defined in PHP_INI_USER or PHP_INI_PERDIR

  • get_cfg_var(): returns the values defined in the php.ini

like image 190
kero Avatar answered Apr 12 '26 09:04

kero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!