Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.



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

share|improve this question
Are you trying to use mod_php or a [F]CGI version? Make sure whatever instructions you're following matches which php5 package you installed. – DerfK Jul 3 '11 at 12:05
1) Do you have PHP installed on your system? 2) Do you have this kind of line in your Apache config LoadModule php5_module libexec/ In other words -- does Apache knows what module to use to process .php files? – LazyOne Jul 3 '11 at 12:07
Well, I installed php using: yast2 -i apache2-mod_php5 – baltusaj Jul 3 '11 at 12:16
No. Could find this line in /etc/apache2/httpd.conf. Also there is no on my system. – baltusaj Jul 3 '11 at 12:22
@Usman Here is the general setup instructions: -- have a look at them. – LazyOne Jul 3 '11 at 13:38
up vote 2 down vote accepted

Adding php5 to APACHE_MODULES in /etc/sysconfig/apache2 and restarting apache solved the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.