php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #35178 PHPRC and Apache 1.x VirtualHosts, RE: Bug #29694
Submitted: 2005-11-09 23:19 UTC Modified: 2005-11-11 15:27 UTC
From: chris_petersen at hotmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chris_petersen at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-11-09 23:19 UTC] chris_petersen at hotmail dot com
Description:
------------
The bug reports and updated documentation for PHP 5 state that the PHPRC variable should no longer be set by Apache 1.x but as a system environment variable instead. What the documentation fails to describe is how the environment variable is to be configured for each Apache 1.x Virtual Host, each with it's own PHP configuration. It appears to me that this PHPRC issue really is a bug and not a documentation issue. It is unreasonable that multiple hosts should share the same php.ini file. Workarounds are to upgrade Apache 1.x to 2.x (not recommended) or roll back to PHP 4.

Reproduce code:
---------------
The "SetEnv PHPRC" in a Apache 1.x httpd.conf file will not be read by PHP5. This can easily be proven using phpinfo().

Expected result:
----------------
There must be a documented method of providing a seperate php.ini for each Apache 1.x virtual host.

Actual result:
--------------
The documentation states that the variable should be set as a system wide environment variable. The documentation fails to state how this should be done when there is more than one virtual host which requires more than one php.ini file.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-10 12:21 UTC] sniper@php.net
This is simply misunderstanding. It's not possible to have different PHPRC environment variables for different virtualhosts.

And "SetEnv PHPRC" is NOT the way to set it.
That is an Apache environment variable, not the system environment PHP uses.

And it's documented properly now -> bogus.

 [2005-11-11 05:30 UTC] chris_petersen at hotmail dot com
I do understand that multiple environment variables cannot be set. I believe I understand now, PHP 5 no longer has a method for allowing multiple configurations for virtual hosts in Apache 1.3.... and isn't intended to. This explains why Woody does not include PHP 5 in Debian: without virtual hosts support PHP 5 isn't useful in an online environment. I guess I'll keep using PHP 4 for online systems and wait for a release that addresses this requirement (PHP6?). I have since found I can use PHP 5 if I use a single PHP.INI, just don't set the docroot and enable most of the packages, except no one in their right mind would do this outside of a development environment.
 [2005-11-11 15:27 UTC] tony2001@php.net
Can you please explain me HOW do you think should be posssible to do it, assuming that an Apache child can be reused multiple times, while PHP loads it's settings only once (at startup)?
I guess you just don't understand the way it works, just think about it, you'll get that it's impossible to make PHP behave differently on different *virtual* hosts, unless every child performs only 1 request and dies just after that (which would be a huge overhead).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 13:00:01 2025 UTC