php not working in Tiger

Discussion in 'Web Design and Development' started by James L, Jan 27, 2006.

  1. macrumors 6502a

    Joined:
    Apr 14, 2004
    #1
    Hey all,

    I had php (the default install in Panther) up and running just fine in Panther. I recall editing a couple of lines in a cong file to get it up and running. While working on code I would keep my php files in my sites folder, and use my localhost to view them in Safari.

    I upgraded to Tiger a little while ago, and just tried to access some php code to make a change or two to a script.

    The php engine does not appear to be up and running. When I load the page in Safari, it just shows the script, like it is a text file.

    I would assume the config file that I edited in Panther was replaced with a default one in Tiger that has php turned off... but I cannot remember which one it was, or how to turn it on again.

    Any thoughts?

    Cheers!
     
  2. macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    chicago
    #2
    /etc/httpd/httpd.conf
     
  3. macrumors member

    Joined:
    Nov 2, 2005
    Location:
    Atlanta, Georgia
    #3
    Copies

    Just for future reference...I always make copies of the (working) httpd.conf file.
    Doesn't hurt to copy ALL PHP files either.
     
  4. macrumors newbie

    Joined:
    Nov 20, 2007
    Location:
    Connecticut
    #4
    php not working in Tiger, for me

    I've tried enabling the php ver. 4 that comes with Tiger, I've edited the httpd.conf file to add the modules, and I still can't get it to work. The webserver works fine but even the simple:

    <?php
    phpinfo();
    ?>

    won't work. I've racked my head all today trying to get this thing to work, but all that comes up is a blank page if I use Flock or just the raw source code of the page if I use Safari (name of the file is "index.php"). I'm stuck, and I don't know where else to look. If anyone has any suggestions I'm more than open to them. Thanks in advance for any help!

    David
     
  5. macrumors member

    Joined:
    Oct 22, 2006
    Location:
    earth
    #5
    I don't remember where I got this from, but adding this section may help you:

    Code:
    <IfModule mod_php4.c>
        # If php is turned on, we repsect .php and .phps files.
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
    
        # Since most users will want index.php to work we
        # also automatically enable index.php
        <IfModule mod_dir.c>
            DirectoryIndex index.html index.php
        </IfModule>
    </IfModule>
    
    Just place it somewhere in your httpd.conf file. Personally, we put it towards the end before the beginning of VirtualHost sections.


    -stndn.
     

Share This Page