Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

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

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

add comment

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

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: 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
add comment

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
add comment

Your Answer

 
discard

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.