Benches Mail, Safari and messaging

3

Opening local PHP files in Safari...

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I have successfully installed MAMP in order to develop some PHP files locally.

However, Safari won't open any file with a ".php" extension (leaves them greyed-out / unselectable).

When I try and "trick" Safari into opening the file (by typing the root address in manually), Safari doesn't render the php -- instead, it displays the raw code.

I have searched this forum, and found discussions from 2 years ago, but unfortunately they aren't relevant to my situation.

Surely I'm not the only person developing local PHP using Safari, am I?

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    eddy kestemont

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I have put all the files on the local Webserver accessed using for example
    http://localhost/index.php

    Of course php has to be active (edit your httpd.conf file to un-comment the relevant lines and restart the Apache server)

    php is a server side script language and has to be processed by the server. Safari by itself doesn't understand php.

    The local WebServer is /Library/Webserver/Documents

    Hope this helps.

  2. 0

    timhuggins

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    thanks eddy.

    I am running MAMP to get php and mySql running locally on my machine. The MAMP prefs pointed to a directory (default) other than "/Library/Webserver/Documents" (which is odd, because it's implicity for mac!)

    Anway -- it's working now that I've pointed it to the right directory (/Library/Webserver/Documents)

    thanks for your help. I appreciate it.

  3. 0

    gPod

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    +I've pointed it to the right directory+

    so.. how and where do you do this? I am one of those posts/threads on this topic from 2 years ago and it was never resolved for Safari. it is a well know issue.

    As I see it.. when you are in Dreamweaver and want to view a php page in Safari, it will render it BUT the moment you leave that page and say hit a navigation button to a new page that is also a php page, it shows nothing but code. ALSO, if you drop a scripted php page onto Safari, you get nothing but code.

    this is NOT the case in Firefox or others browsers I check in. either of those same actions above work fine and render the page - not show code view - of the php document.

    so are you saying that "I've pointed it to the right directory" addressed both of those issues for you? If so, how did you do it and where are the "MMAP prefs" changed?