PHP file gets download instead of getting executed when browsed in any browser
- by baltusaj
I have a phpinfo.php file which I am trying to run by browsing to it using browser but the browser downloads the file instead of executing it.
phpinfo.php
<?php
phpinfo();
?>
I followed following this post, added following lines to my /etc/apache2/httpd.conf and restarted apache but invain. phpinfo.php still gets downloaded.
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Have I added these line to the correct file?
On an openSuSE forum following was mentioned. I followed this too but still no success. Same problem is persisting.
In case the browser wants to save your
php files instead of displaying the
content, you should enable php support
in the /etc/apache2/mod_userdir.conf
file. Add the following line to it,
just after the line and restart
the server.
Include /etc/apache2/conf.d/php5.conf