在Firefox中打开PHP文件时提示下载 [英] Prompted to download when opening PHP files in firefox
问题描述
我正在研究PHP教程,但遇到了问题,因为我无法在firefox中打开本地php文件.我只是被提示用另一个程序打开它们.我正在使用Mac,顺便说一句.我尝试过/已经知道的事情:
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:
- 删除mimetype.rdf文件
- 按住Control键并单击该文件,然后选择使用firefox打开.无法使用,因为Firefox总是变灰.
- 我确实安装了本地网络服务器.我在使用本机Mac本地网络服务器时遇到了麻烦,因此我安装了MAMP,可以很好地提供javascript文件.
- 我遇到了一些有关从下载操作中删除php的事情,但是我似乎找不到任何关于这实际上意味着什么或如何执行的信息.
我一直在互联网上寻找解决方案,对我来说找不到任何东西真是太疯狂了.我知道这里也有一些类似的问题,但是它们似乎都具有某些不适用于我的情况的方面.我还在MAMP论坛上找到了有关此内容的信息,但从2008年起就再也没有解决过.有人吗?
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?
推荐答案
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.
有关升级到优胜美地后设置apache的说明中所包含内容的摘要,请参见
For a summary of what is included in the instructions for setting up apache after upgrading to Yosemite, see my answer in this post .
这篇关于在Firefox中打开PHP文件时提示下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!