I want to set the include_path variable in my php.ini file (C:\Windows\php.ini).
But, I want different include_path values for different sites hosted on the same Windows server. How can I do this?
http://php.net/manual/en/configuration.file.php says:
php.ini is searched for in these locations (in order):
. . .
You can review this list and see if one of the techniques helps in your case. For example, you can set the environment variable PHPRC, or you can put a different php.ini file in each current working directory, assuming each virtual host has a distinct cwd.
Note that when using Apache and mod_php, or other module embedding PHP in the web server (e.g. FastCGI), the php.ini file is read once, at web server startup. When you use PHP in a CGI manner, the php.ini file is read during every web request, so you have more opportunity to use a different php.ini.
You can set the php include_path from an .htaccess file, assuming you have the correct AllowOverride settings in your httpd.conf file. Here's an example how:
.htaccess
php_value include_path "d:\path\to\include"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With