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?
For some reason PHP is not running. Make sure:
If both apply, please indeed post Apache config files.
There are several things to do:
1- You need to make sure that the appropriate php module is installed. Use;
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.
3- You just need to reload/restart your apache server after applying the needed changes.