Hi everyone.
I just discovered what seems to be a Apache bug, could anybody please confirm or deny this?
I have Linux 2.2.16, Apache 1.3.20, PHP 4.0.6.
Apache resides in /usr/local/apache, the $DOCUMENT_ROOT being ~/htdocs.
The VirtualHost entry for the main site points to /usr/local/apache/htdocs, I'll call this Host a).
Another VirtualHost points to /usr/local/apache/htdocs/hosting/dsweb, I'll call this Host b). This is where the problem occures.
First let me note that everything works fine except that issue. Both sites are running, the ftp home for Host b) is chrooted etc. etc.
Now on Host b) I have this /guestbook.php which does a require_once('./admin/conf.inc'); at the very beginning.
This works as it should and sets basic parameters. After that a few other includes are loaded, again working fine.
After that I do a fopen("http://$SERVER_NAME/index.php?cid=56", "r"); to get the beginning of the HTML output for /guestbook.php.
(I know this is bad behaviour but time demanded that quick and dirty approach).
$SERVER_NAME in this context points to Host b) as it should.
Now, in /index.php (which I called by fopen) I require_once("./admin/conf.inc"); again. This time $SERVER_NAME points to Host a)!
Note that in /guestbook.php everything works fine even after the fopen because I get the HTML output from /index.php, not the PHP source.
When I call /index.php directly through my browser the $SERVER_NAME points to Host b) as it should. When fopen'ed the $DOCUMENT_ROOT points to Host a) as well, leading to includes not being found, messing the whole thing.
To sum it up:
The output from /guestbook.php works, but is missing the fopen'ed Output from /index.php.
/index.php on its own is working.
Can anybody confirm/deny this situation or maybe point out where the problem is?
Thx in advance,
Dominique