Sometimes php output downloads instead of rendering in browser

hi

it seems in firefox sometimes attempts to download a PHP file instead of showing it’s HTML output in the browser.
if I go along with it and download the PHP file (for example “index.php”), I see that it doesn’t actually contain the PHP source code but the HTML output of it,
the weird thing is that it happen every once in a while… e.g: the same file “index.php” sometimes works fine in the browser and sometimes firefox tries to download it.
and it can happens to any .PHP file on the site, not a particular one.

is there something that can be done in the PHP code to prevent this ?

what you can do in PHP is set the correct headers. although that doesn’t help if the webserver changes them after PHP is done.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.