httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enlightenment <enlightenm...@scholieren.com>
Subject [users@httpd] [Bug] Apache 2.0.46 messes up virtual hosts using php_value auto_prepend_file
Date Sun, 06 Jul 2003 09:53:45 GMT
Hello all,

I'm encountering a difficult problem, and I think it is a bug.


*The situation:*

- I use both Apache 2.0.46 and PHP 4.3.3RC1
- I have two VirtualHosts in my httpd.conf: www.fluffles.net 
<http://www.fluffles.net> and sqladmin.fluffles.net
- I have an unedited php.ini


*The problem:*

Sometimes when I'm browsing pages on the sqladmin.fluffles.net 
VirtualHost, i get the following PHP error:

code:
------------------------------------------------------------------------
Warning: head(/www/sqladmin.fluffles.net/head.php):
failed to open stream: No such file or directory
in /usr/local/www/sites/fluffles.net/init.php on line 63
------------------------------------------------------------------------



*What I believe is happening:*

I think Apache mixes up the two different VirtualHosts. As i'm browsing 
on sqladmin.fluffles.net, Apache surely has *nothing* to do on the 
/sites/fluffles.net/ directory.

It may have something to do with a special directive I use in my 
httpd.conf:

code:
------------------------------------------------------------------------
NameVirtualHost *

<VirtualHost *>
    ServerName 62.216.x.x
    DocumentRoot /www/default
    ErrorLog /www/logs/default-error
    CustomLog /www/logs/default-access common
</VirtualHost>

<VirtualHost *>
    ServerName www.fluffles.net <http://www.fluffles.net>
    DocumentRoot /www/fluffles.net
    ErrorLog /www/logs/fluffles.net-error
    CustomLog /www/logs/fluffles.net-access common
    ErrorDocument 403 /error.php?error=403
    ErrorDocument 404 /error.php?error=404
    php_value auto_prepend_file /www/fluffles.net/init.php
</VirtualHost>

<VirtualHost *>
    ServerName sqladmin.fluffles.net
    DocumentRoot /www/sqladmin.fluffles.net
    ErrorLog /www/logs/sqladmin.fluffles.net-error
    CustomLog /www/logs/sqladmin.fluffles.net-access common
</VirtualHost>
------------------------------------------------------------------------

As you can see, for www.fluffles.net <http://www.fluffles.net> I use the 
php_value auto_prepend_file, so that for every document requested, 
init.php is prepended first.


*So what is the bug?*

I believe Apache sometimes prepends the init.php from www.fluffles.net 
<http://www.fluffles.net> on an sqladmin.fluffles.net request. But in 
the init.php other files are included as well, but since these are out 
of the scope of sqladmin, a very weird error is produced by PHP.


*What do you guys think?*

I was thorough in my research afaik. I setup a new webserver from 
scratch. But I got the same problems. The previous one used PHP 4.3.2 
final, the new one uses 4.3.3RC1, no difference. On the first line of 
init.php I put echo('XXX'); and some pages on sqladmin would actually 
print out XXX, this means that Apache makes a big mistake by messing up 
the VirtualHosts. Am i correct?

Further information: both webservers are on different physical machines, 
use modern hardware and run FreeBSD 5.1-RELEASE.

Thanks!

- Enlightenment

Mime
View raw message