Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

James L

macrumors 6502a
Original poster
Apr 14, 2004
850
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!
 

dcanizar

macrumors newbie
Nov 20, 2007
1
0
Connecticut
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
 

stndn

macrumors member
Oct 22, 2006
80
1
earth
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.