I am writing a script that requires me to get all php configuration. But I stumble an issue and inconsistencies when I run the ini_get_all() in the browser and using php5-cli. Here is my code snippet:
$confiq = ini_get_all();
echo $config['memory_limit']['local_value'];
It return 128M when I run using browsers, but it return -1 when I run using php5-cli from the command line
EDIT: It turned out they are using two different php.ini files. I checked the cli .ini with php --ini command. Now I need to figure out how to change the location for .ini file for cli
EDIT: For the easy hack, I created symbolic links to the apache2 php.ini to make sure both using the same php.ini.