By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Per-server PHP config override

P: n/a
Hi,

I'm using Apache webserver 1.3.27 and PHP 4.3.0. On my development machine,
I have created several virtual hosts. AFAIK PHP configuration is stored in
php.ini. I want some of the virtual hosts override some of PHP
configuration, while the rest retain the configuration in the php.ini. How
can I achieve this? I'm thinking a similar approach like Apache's
httpd.conf and .htaccess, but how to do it with PHP.

Furthermore, one of my project involves multiple subdomains, each
implemented by way of virtual hosts. Say a domain dev.foo.net have several
subdomains (dev.sd1.foo.net, dev.sd2.foo.net, etc), and I have other
domains configured in my machine, like dev.bar.org and wdv.blah.com. Also
say that default php.ini is the default config for all domains in my
machine. How can I make a configuration override applicable only from
dev.foo.net and it's subdomains, but not applicable to other domains
(dev.bat.org and wdv.blah.com uses the default php.ini entirely).

Oh, BTW, the machine is running on WinXP sp1a.

TIA
Jul 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ricky Romaya wrote:
Hi,

I'm using Apache webserver 1.3.27 and PHP 4.3.0. On my development machine,
I have created several virtual hosts. AFAIK PHP configuration is stored in
php.ini. I want some of the virtual hosts override some of PHP
configuration, while the rest retain the configuration in the php.ini. How
can I achieve this? I'm thinking a similar approach like Apache's
httpd.conf and .htaccess, but how to do it with PHP.
You can put PHP settings in the .htaccess, depending on your Apache
configuration, example:

php_flag allow_call_time_pass_reference off

see:

http://www.php.net/manual/en/configuration.changes.php
PHP: How to change configuration settings - Manual
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jul 11 '06 #2

P: n/a

Jonathan N. Little wrote:
Ricky Romaya wrote:
Hi,

I'm using Apache webserver 1.3.27 and PHP 4.3.0. On my development machine,
I have created several virtual hosts. AFAIK PHP configuration is stored in
php.ini. I want some of the virtual hosts override some of PHP
configuration, while the rest retain the configuration in the php.ini. How
can I achieve this? I'm thinking a similar approach like Apache's
httpd.conf and .htaccess, but how to do it with PHP.

You can put PHP settings in the .htaccess, depending on your Apache
configuration, example:

php_flag allow_call_time_pass_reference off

see:

http://www.php.net/manual/en/configuration.changes.php
PHP: How to change configuration settings - Manual
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

You can also use the php_* directives in the virtual host config
(<VirtualHosttags), though this requires a restart of apache for the
changes to take effect, unlike .htaccess

Jul 11 '06 #3

P: n/a
"Jonathan N. Little" <lw*****@centralva.netwrote in
news:d6**************************@NAXS.COM:
>
You can put PHP settings in the .htaccess, depending on your Apache
configuration, example:

php_flag allow_call_time_pass_reference off
Yes, I have read about it also, but I want to keep PHP configs seperated
with Apache (.htaccess).

On at least one hosting I have used before, they have an option to "Create
your own PHP.ini", which indicates a capability of having a php.ini per
domain basis. Sadly, they won't tell me how it could be done. This is what
I'm aimimg for.

TIA
Jul 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.