Search code examples
phpfirefoxmamp

Prompted to download when opening PHP files in firefox


I'm working through a PHP tutorial and I'm having issues because I can't open local php files in firefox. I just get prompted to open them with another program. I'm using a mac, btw. Things I've tried/already know:

  • Deleting the mimetype.rdf file
  • Control+clicking the file and choosing to open with firefox. won't work because firefox is always grayed out.
  • I do have a local webserver installed. I've been having troubles with the native Mac local webserver, so I installed MAMP and I can serve up javascript files just fine.
  • I came across something about removing php from your download actions, but I can't seem to find anything about what that actually means or how to do it.

I've been looking all over the internet for a solution to this, it seems really crazy to me that I can't find anything. I know there are some similar questions posted on here, but they all seem to have particular aspects that don't apply to my case. I also found something about this on the MAMP forums but it was never resolved from back in 2008. Anyone?


Solution

  • I worked through these instructions to solve a problem I was having with setting up my local Sites directory after upgrading Yosemite and then I could actually open the PHP file. Then I had to go to my httpd.conf file in /etc/apache2 and uncomment LoadModule php5_module libexec/apache2/libphp5.so to get the PHP to actually load.

    For a summary of what is included in the instructions for setting up apache after upgrading to Yosemite, see my answer in this post .