I recently downloaded OpenSUSE OS version 11.4 from the site to use it as a server..In order to do that I downloaded the server edition that has Apache/2.2.17 and PHP5 downloaded by default.....Ok till now it is fine

Now I started the Apache successfully and put a test.php file in the documentRoot directory. test.php contain only <?php phpinfo() ?>

Then using my browser I typed http://localhost/test.php and here was the problem the browser didn't display what phpinfo() should display, instead it asked me whether I want to open or save test.php...which is driving me crazy.... I googled a lot but no solution

THis is /etc/apache2/conf.d/php5.conf

(IfModule mod_php5.c)

    AddHandler application/x-httpd-php .php4
    AddHandler application/x-httpd-php .php5
    AddHandler application/x-httpd-php .php
    AddHandler application/x-httpd-php-source .php4s
    AddHandler application/x-httpd-php-source .php5s
    AddHandler application/x-httpd-php-source .phps
    DirectoryIndex index.php4
    DirectoryIndex index.php5
    DirectoryIndex index.php

(/IfModule)

link|improve this question
Is there a particular need for the excessive quantity of question marks? – Lightness Races in Orbit Jul 4 '11 at 17:57
Can you post your httpd.conf ? The part for PHP only not all of it. – Michael B. Jul 4 '11 at 17:58
ok just a minute – Ala ABUDEEB Jul 4 '11 at 18:00
feedback

migrated from stackoverflow.com Jul 4 '11 at 18:05

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

2 Answers

Take a look at PHP documentation and make sure the configuration is right

http://www.php.net/manual/en/install.unix.apache2.php

This should be in your httpd.conf

LoadModule php5_module modules/libphp5.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
link|improve this answer
I can't find libphp5.so on my whole system, but i found mod_php5.so – Ala ABUDEEB Jul 4 '11 at 18:12
@Ala ADUDEEB try with this. Make sure your file php5.conf is included in your default conf – Michael B. Jul 4 '11 at 18:23
php5.conf is in /etc/apache2/conf.d which is used by default by apache so this is not the problem – Ala ABUDEEB Jul 4 '11 at 18:34
feedback

sounds like mod_php5 is disabled somehow

try (as root)

a2enmod php5
service apache2 restart

Then try to access the pages again

link|improve this answer
I did, but it writes "php5 already exists" – Ala ABUDEEB Jul 4 '11 at 18:23
feedback

Your Answer

 
or
required, but never shown

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