penders - 9:23 am on Jun 22, 2011 (gmt 0)
May be a background-image isn't the correct tool here and an absolutely positioned IMG (positioned behind other content), as in @pokra's solution would be better? This could be altered to simply:
<img src="bgimage.php" alt="" style="position: absolute;">
Which doesn't rely on the actual page being rendered by PHP.
(2) Or, may be... load the image in a hidden IMG element (nothing is currently set as the background-image of the DIV container). Get the dimensions of this image (as above) and then set the dimensions AND background-image of your DIV container to the same as the IMG element. Not that this is possible though?