Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome forces download of PHP scripts' source

I'm experiencing a behaviour of Google Chrome (Google Chrome 7.0.517.41 beta) that I can't understand. In some cases, Google Chrome downloads the source code of the PHP script that is requested from my server instead of it being executed. I don't have this problem with cURL or Firefox; when I request the same URL with them the script is executed properly.

This seems to me rather odd because I this should be a server issue and it should work the same in every browser. I think I must have overlooked something or Google Chrome is sending some unusual HTTP headers... I don't know. I've checked AddHandler and AddType directives in Apache configuration files with no success. Do you have any idea what might be causing this?

like image 566
Jindřich Mynarz Avatar asked Dec 21 '22 22:12

Jindřich Mynarz


1 Answers

The solution for this issue was to clear the Google Chrome's cache which seems to hold some data cached for too long. It was probably wrong on the server as it was sending raw PHP code previously but due to caching this issue persisted for Google Chrome even after it was fixed.

Thanks to Jon Cram for the suggestion.

like image 140
Jindřich Mynarz Avatar answered Jan 03 '23 11:01

Jindřich Mynarz