This is a bit hacky, but I think this is what you are looking for, so here you need to override the parse_ini_file function and ignore the invalid path ( "/usr/local/apache2/myconfigs/settings.ini" ) and use your correct file instead.
This seems simple, but a bit complicated, since your new function must somehow call the parse_ini_file function, so you need to rename it first and then redefine it .
For this you will need the runkit PHP extension , see runkit_function_redefine and runkit_function_rename for help.
Unconfirmed, but should work, the code should be something around these lines:
runkit_function_rename('parse_ini_file','original_parse_ini_file'); runkit_function_redefine('parse_ini_file', function() { original_parse_ini_file("C:\wamp64\bin\apache\apache2.4.27\myconfigs\settings.ini", true); });
Make sure the above code runs at the beginning of your script application, and any call to parse_ini_file should use your file instead of hard-coded.
If the application does not have a single entry point where you can place the code above, you can put it in a separate script and make PHP load before running any script using the auto_prepend_file parameter in settings.ini , also make sure that runkit.internal_override set to On , since parse_ini_file not a user-defined function.
source share