A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearCan I have multiple php.ini files? - page 1
User InfoPosts
Can I have multiple php.ini files?#1
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?

posted date: 2008-12-08 13:01:00

Re: Can I have multiple php.ini files?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-08 13:01:01

Re: Can I have multiple php.ini files?#3
Unfortunately, I don't think you can. However, some webservers can change PHP settings on an individual basis... Apache using mod_php has the php_value setting that you can set on various virtual hosts, IIS might have something similar, but I'm not sure.set_include_path can also override the include path at runtime.P.S. TF2 Engineer for the win.

posted date: 2008-12-08 13:06:00

Re: Can I have multiple php.ini files?#4
http://php.net/manual/en/configuration.php says:php.ini is searched 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.

posted date: 2008-12-08 13:07:00

Re: Can I have multiple php.ini files?#5
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:.htaccessphp_value include_path "d:\path\to\include"

posted date: 2008-12-08 13:13:00

Re: Can I have multiple php.ini files?#6
The question never mentions Apache.

posted date: 2008-12-08 13:17:00

Re: Can I have multiple php.ini files?#7
As I understand the question, its more important to have individual include paths for each server/site then multiple php.ini files? Id say keep your code in PHP as far as possible.Then you can just set the include_path with set_include_path or ini_set.In apache you can set it in virtual domain or .htaccess file with php_value include_path "<first path to look>:<second path>:<etc>:.". IIS probably has a similar method.

posted date: 2008-12-08 13:28:00

Re: Can I have multiple php.ini files?#8
The question DOES mention Windows.

posted date: 2008-12-10 11:14:00

Re: Can I have multiple php.ini files?#9
works like charm!

posted date: 2009-02-21 00:16:00

select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.