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 recompiled PHP earlier today, now when you access PHP pages in a browser, Apache displays its source code instead of parsing it. Do I need to reset some configuration or recompile Apache?

This is on Centos 5.5 with Apache 2.2 and PHP 5.2.17

share|improve this question

migrated from stackoverflow.com Oct 11 '11 at 4:22

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

    
How is this off topic? –  gAMBOOKa Oct 11 '11 at 3:57
    
Guess you're right. How can it be migrated? –  gAMBOOKa Oct 11 '11 at 4:05
    
It just needs to be voted there a few more times, wait and see. –  deceze Oct 11 '11 at 4:12
    
I'm not sure serverfault really wants the 504th duplicate asking for basic apache and php setup instructions. –  mario Oct 11 '11 at 4:17
    
AddType application/x-httpd-php php –  Lazy Badger Oct 11 '11 at 6:45

2 Answers 2

up vote 3 down vote accepted

Check to make sure your libphp.so (or libphp5.so) is in the correct place. If it got installed in a different place, you'll need to update where apache thinks it is. Depending on how you've got apache setup, there should be an IfModule block that loads the apache module. It'll look something like this:

<IfModule !mod_php5.c>
    LoadModule php5_module    /usr/lib/php5.3/apache2/libphp5.so
</IfModule>

The path and module name may be different. But if that's all fine, it may be you're using an "Action" with ExecCGI, for example:

AddHandler php-cgi .php
Action php-cgi /var/www/localhost/cgi-bin/php.cgi

The path to the cgi module may have changed.

share|improve this answer

From the command line type:

apachectl configtest

Do you get any errors?

In httpd.conf is the following line uncommented:

LoadModule php5_module ...

share|improve this answer

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.