I’d like to compare the settings I have on 2 different servers. Both are shared hosting so I don’t think I have enough access to do it any other way but programmatically with phpinfo. So now that I have the 2 outputs, I’d like to compare them without examining them manually. Is there an automated way for this?
Also, as a side but related note, I think phpinfo is the output of php.ini. Is this correct?
From the PHP Manual on
phpinfo():phpinfo()does more than just printing outphp.inisettings.If you want to process
php.inisettings manually, you might want to check outini_get_all()instead ofphpinfo(). This returns an array of all configuration values.You could transfer the output of
ini_get_all()from server A to server B (for example by usingvar_export()to create PHP code to create the array, orserialize()), then usearray_diff_assoc()to compare the settings.export.php: (Server A)
compare.php: (Server B)