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 installed Apache. Its working fine.

I have also PHP 5.2.1 installed.

I have enabled load module in http.conf also

I have also added following in mime.types

AddType application/x-httpd-php php
AddType application/x-httpd-php-source  phps

But Still I am .php page along with php code. It gets executed but also shows the php code same as written. What else configuration remaining?

Solutions: Add SetHandler in http.conf file

<FilesMatch \.php$>
      SetHandler application/x-httpd-php
share|improve this question

migrated from Jun 19 '10 at 2:19

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

While you seem to have fixed it (as posted in other comments), I think I see your problem.

The AddType directive seems to like having a dot in the extension. Your posted configuration is missing them.

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
share|improve this answer
Should we add the given code in mime.types or http.conf – KoolKabin Jun 20 '10 at 9:17

Have you installed php?

Or you can try other popular packages for basic web server functionality:

share|improve this answer
or WAMP or EasyPHP – Chief17 Jun 18 '10 at 18:05
Yeah I do Have installed PHP. Its in c:\php folder. I am trying to do it manually... not using xampp or zend server – KoolKabin Jun 18 '10 at 18:06
check this: and follow 'Installing as an Apache handler' – Carson Jun 18 '10 at 18:11
thnx.. addhandler worked.... Actually i found out that i placed my add type code placed in next file. – KoolKabin Jun 18 '10 at 18:15

Did you make sure to restart Apache after making the config changes?

Also clear your browser's cache - this was the problem the last time I had this issue. I went so far as using another browser to make sure.

share|improve this answer
yeah fine its working now... I use addhandler method – KoolKabin Jun 18 '10 at 18:17

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.