Page 1 of 1
Changing the php.ini that is loaded
Posted: Wed Feb 02, 2005 5:27 am
by malcolmboston
Im currently having problems with my web server as it is not loading the expected php.ini
im wanting to know if theres anyway of specifying the php.ini that is loaded everytime
short and sweet
also is there anywhere that specifies which one is loaded each time?
i dont think there is mind
Thanks
Mal
Posted: Wed Feb 02, 2005 8:35 am
by mmanders
I'm a relative newbie at PHP so this may or may not help. It depends why specifically you need to load a particular php.in file.
If you want to override certain php.ini directives like say include_path, there are functions that let you do this, however they generally only change the directive for the duration of the script.
Lets say you wanted a different include_dir to the one php.in sets out, at the top of your script use
Code: Select all
$path = 'new_path';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
This will set the include_path for the script to be the existing path as well as the new path you specify - there are probably other functions similar to this for setting different php.ini directives.
Hope this helps :-S
Posted: Wed Feb 02, 2005 8:52 am
by timvw
Posted: Wed Feb 02, 2005 10:49 am
by malcolmboston
basically i needed it because it was loading a different version of PHP.ini that i wanted it too
Posted: Wed Feb 02, 2005 11:42 am
by timvw
as mentionned in the manual, PHPRC environment variable is easiest
