php not working in Tiger

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

  1. macrumors 6502a

    Apr 14, 2004
    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?

  2. macrumors 601


    Jul 18, 2002
  3. macrumors member

    Nov 2, 2005
    Atlanta, Georgia

    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

    Nov 20, 2007
    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:


    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!

  5. macrumors member

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

    <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
    Just place it somewhere in your httpd.conf file. Personally, we put it towards the end before the beginning of VirtualHost sections.


Share This Page