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
</FilesMatch>
link|improve this question
feedback

migrated from stackoverflow.com Jun 19 '10 at 2:19

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

3 Answers

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
link|improve this answer
Should we add the given code in mime.types or http.conf – KoolKabin Jun 20 '10 at 9:17
feedback

Have you installed php?

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

link|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: php.net/manual/de/install.windows.apache2.php 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
feedback

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.

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

Your Answer

 
or
required, but never shown

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