PHP files are downloaded by browser instead of processed by the server, how to solve it?


 
 
After upgraded some packages in my ubuntu server, sometimes php configuration goes crazy and PHP files are downloaded by browser instead of processed by the server, how to solve it? Here are the steps to solve fastly the problem.
 
Follow thiese commands:
 
Code:
sudo a2enmod php5
and it said "Module php5 already enabled". 
 
re-starting apache2 with the following command:
 
Code:
sudo apache2ctl restart
and PHP started parsing and working fine after that. 
 
 
Alternatively use these steps too:
I already have apache2 server running on my machine, so I reinstall only PHP5 and mySQL 5 using
 
Code:
sudo apt-get install php5-mysql libapache2-mod-php5 mysql-server
 
(During the installation, the apache2 server on my machine stops and re-starts.)
 
 
Then repeat the steps above.
 
 


We use our own cookies and third-party cookies to improve our services, show products based on your preferences, analyse the browsing habits of our users, and enable interaction with social networks. Continuing to browse our sites implies full acceptance of their use. You can change your cookie setting or get more information here: Cookies policy .