Hello everyone!
I have been designing my own php driven website for some time, and I am now interested on setting up a testing server on my computer.
I finally got php and mysql installed and working with apache.
I have my own "site engine" set up, so all the file requests handled by Apache are redirected through my php script. I then process them (convert urls, generate pages, etc), and send them back to Apache to be sent to the browser.
The problem I am having is that image files aern't being displayed.
The code i am using to open the image file is:
code:
header("X-Powered-By: ATIServer/Static");
header('Cache-Control: public, max-age=604800, must-revalidate');
header('Expires: '.gmdate('D, d M Y H:i:s',time()+604800).' GMT');
header("Content-Type: {$_SERVER['FAKE_EXT']['mime']}");
$f = @fopen($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'],"rb");
while (!feof($f)) {
echo fread($f, 8192);
}
fclose($f);
exit();
For other static files (css, js, etc) it works perfectly. For image files, the browser displays an "this image contains errors" message.
I think that the problem must have something to do with the fact that the image files are larger than the other files. Do you think it would truncate them, or something?
Is there some setting in Apache or php's .ini file that would make this work?
P.S. Don't ask about the $_SERVER['FAKE_EXT'] :-) That has already been set up by my site engine :-)
Thanks,
-Robur
------ edit ------
Just thought I might add that I am using PHP version 5, MySQL Client Version 5.0.1, and Apache version {whatever the default apache version that comes bundled with mac os X.3.9 is (think its 1.something)}.
(Edited by robur on 05-24-2005 21:43)