我一直在尝试从源代码安装Apache和PHP,以便它们协同工作,作为一个"看看我是否可以"的项目。
但是,当我尝试加载"localhost"文件时,Firefox 只是开始下载.php页面而不是打开它。
我很确定我已经在 ./conf/httpd.conf 中添加了正确的处理程序,它们如下所示
#configure for php
AddHandler php-script .php
AddType text/html .php
AddType application/x-httpd-php-source phps
AddType application/x-httpd-php5 .php
我也尝试过更换
AddType application/x-httpd-php5 .php
跟
AddType application/x-httpd-php5 php
和
AddType application/x-httpd-php .php
和
AddType application/x-httpd-php php
你配置了 apache 来加载 php 模块了吗?看看这里:http://www.petefreitag.com/item/516.cfm