I have created a webserver with apache2 and it seems to run fine . I have also installed php5 on the server .To test if php is working , i have created a test.php with a phpinfo() function call and put this file in /var/www. whenever I point my browser to the php file location it asks me to download the file rather than running it . What's wrong here?
There are several things to do:
1- You need to make sure that the appropriate php module is installed. Use;
dpkg -l | grep php to list the php related packages.
2- You need to make sure you have a line similar to this in your apache configuration. This line enable the execution of PHP files under specific directory.
AddType application/x-httpd-php .php
3- You just need to reload/restart your apache server after applying the needed changes.