Forum Moderators: coopster
I have a simple PHP include for putting my site header graphic/menu on every page. The code I use is this:
<?php include("_include/header.html");?>
The site looks fine to me and no errors are apparent anywhere, and no one has complained of seeing something weird. The included file does not contain anything other than a simple html table and link to the header graphic.
In my logs I have found repeated instances like this (xxx'ing out my server's IP which is what's calling this header file):
xxx.xxx.x.x - - [30/Apr/2003:00:30:49 -0600] "GET /_include/header.html HTTP/1.0" 200 1289 "-" "-"
xxx.xxx.x.x - - [30/Apr/2003:00:30:53 -0600] "GET /_include/header.html HTTP/1.0" 200 1289 "-" "-"
xxx.xxx.x.x - - [30/Apr/2003:00:31:01 -0600] "GET /_include/header.html HTTP/1.0" 200 1289 "-" "-"
xxx.xxx.x.x - - [30/Apr/2003:00:31:06 -0600] "GET /_include/header.html HTTP/1.0" 200 1289 "-" "-"
xxx.xxx.x.x - - [30/Apr/2003:00:31:11 -0600] "GET /_include/header.html HTTP/1.0" 200 1289 "-" "-"
This happens fairly often, and I've seen it show up with up to around 70 instances one after the other. There is very little traffic as this is a new site. I've seen this appear even when no apparent visitors were around. The host says the PHP include shouldn't do a GET (I honestly have no clue). I have no scripts or anything running on this site, it's all HTML/XHTML code. The pages all have a .php extension. I intend to do more with PHP on the site in future, that's why I didn't just use SSI.
Anyone know why this is occurring, or what I should ask/tell my host about it? All they said was it looks like something's doing a loop but there's nothing that should do that, as far as I can tell. Have I messed up even my one simple line of PHP? :-O
PS -- I'm on a Linux server running Apache and PHP 4.3.0 if you need to know. Thanks :-)
Are you on a dedicated server or is it a virtual server which you are sharing with other people? If it is the latter, it could be that another client on your shared server is calling your includes.
"Did you do anything like include("http://www.yourdomain.com/_include/header.html") "
No, it's exactly as posted above...no full path is stated, it's just <?php include("_include/header.html");?>
It is indeed on a shared server, and in fact the site has a shared IP. I've never had a site with a shared IP before and had no idea what the ramifications might be. I am going to request a unique IP for the site and see if that puts a stop to it. I'll report back on the results in case anyone else comes here with a similar problem. Thanks for the heads up :-)