On a symfony production server, an automatic update has uninstalled libapache2-mod-php5. So after that, whenever you try to access a website page, it downloads the index.php file as text:
<?php
require_once(dirname(__FILE__) . '/../config/ProjectConfiguration.class.php');
date_default_timezone_set('Europe/Paris');
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);
sfContext::createInstance($configuration)->dispatch();
This ubuntu forum shows how to reinstall libapache2-mod-php5 to fix the problem:
sudo apt-get install libapache2-mod-php5
sudo a2enmod php5
sudo service apache2 restart
Now if I open the website in another browser, it works fine. However, chrome kept the broken version in his cache, and when I access the fixed website, it still downloads index.php instead of showing the homepage.
Obviously, I would like to avoid having to say to customers “clear your cookies and your browsing history”… Do you have a server-side solution to force the browser not to use his cache ?
Note: clearing the Symfony cache doesn’t help
This looks like the browser never sends a request to the server. So there’s nothing you can do.