Results 1 to 6 of 6

Thread: PHP not working in RH8

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94

    PHP not working in RH8

    I've just installed RH8, with Apache 2.0 and PHP 4.2. Apache works fine, but PHP doesn't appear to be doing anything at all. I've dropped a page called phpinfo.php with the following code:

    Code:
    <?php
    phpinfo;
    ?>
    but i get a blank page. Viewing the source of the page shows code above. I have more complicated pages, with results of db queries being displayed, and these are broken on this webserver too. They work fine on the old Apache 1.3/PHP 4.1 server. Any ideas as to why I am able to view php pages, but only able to see html code on such pages, and not the php code? My /etc/httpd/conf.d/php.conf file is below, and I have checked that the libphp4.so file is where it should be.

    Code:
    #
    # PHP is an HTML-embedded scripting language which attempts to make it
    # easy for developers to write dynamically generated webpages.
    #
    
    LoadModule php4_module modules/libphp4.so
    
    #
    # Cause the PHP interpreter handle files with a .php extension.
    #
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
        LimitRequestBody 524288
    </Files>
    
    #
    # Add index.php to the list of files that will be served as directory
    # indexes.
    #
    DirectoryIndex index.php

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    472

    Re:PHP not working in RH8

    <?php
    phpinfo;
    ?>

    should be

    <?php
    phpinfo();
    ?>

    Note the () after phpinfo

  3. #3
    Advisor
    Join Date
    Apr 2002
    Posts
    858

    Re:PHP not working in RH8

    Check your httpd.conf file, i'm not sure where it is in RH, but it should have all of the following lines in it somewhere:

    Code:
    AddModule mod_php4.c
    
    AddType application/x-httpd-php .php .php3
    and if you want apache to direct to index.php as well as index.html, add

    Code:
    <IfModule mod_dir.c>
        DirectoryIndex index.php index.html
    </IfModule>
    With that in there it should work, although after editing the text file you will need to restart apache.

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94

    Re:PHP not working in RH8

    ph34r - oops, that was a typo, in the post. I had the "()" in the script.

    PK - Not 100% on this, but my understanding is that in Apache 2.0, all this stuff goes in the .conf files in /path_to_apache/conf.d/ . httpd.conf has a line "Include ../conf.d/*.conf" or similar.

    I'm struggling with Bind 9 at the mome, but am going to attempt to build these from source, see what happens.

    Thanks,

    David.

  5. #5
    Advisor
    Join Date
    Apr 2002
    Posts
    858

    Re:PHP not working in RH8

    [quote author=Pleiades link=board=4;threadid=6381;start=0#60396 date=1045649065]
    PK - Not 100% on this, but my understanding is that in Apache 2.0, all this stuff goes in the .conf files in /path_to_apache/conf.d/ . httpd.conf has a line "Include ../conf.d/*.conf" or similar.
    [/quote]

    Could be wrong, but i would guess that that's a RH thing, not an apache 2 thing, they tend to like to change config files i have found do make sure that those lines are somehow getting included somehow though, how they are included shouldn't really matter.

  6. #6
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94

    Re:PHP not working in RH8

    Thanks for the replies on this, guys.

    I had to rebuild the machine a couple of times (for various complicated and valid reasons :-\ ), and when I put it back to RH8, PHP worked a treat.

    David

Similar Threads

  1. Imq not working
    By sahilmakkar in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 12-05-2010, 10:29 PM
  2. Imq not working
    By sahilmakkar in forum Linux - General Topics
    Replies: 0
    Last Post: 11-09-2010, 12:45 PM
  3. init not working
    By JoeyJoeJoe in forum Linux - General Topics
    Replies: 5
    Last Post: 11-19-2006, 11:06 PM
  4. Pad not working
    By TeRG in forum Linux Distros
    Replies: 1
    Last Post: 03-16-2004, 03:52 AM
  5. Almost got it working...
    By gmoreno in forum Linux - General Topics
    Replies: 6
    Last Post: 12-19-2001, 02:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •