0

最近我将Apache 2.2服务器配置为运行PHP并配置为PHP 5作为模块加载。我可以毫无问题地启动 Apache,但是当我尝试运行 PHP 文件时,它会弹出你想打开还是保存文件?

继续运行Windows XP SP3

Internet Explorer浏览器但不相关

只是尝试将其作为文件打开而不是我的文件,index.php并且没有设置 Apache 将其作为我的index. 如果有帮助,我认为我的问题可能在这里:

;AddType application/x-httpd-php .php
;AddType application/x-httpd-php .php5
;AddType application/x-httpd-php .phtml

我尝试在我的 Apache conf 文件中进行修改,addtypeaddhandler没有任何更改,并且 apache 仍然以两种方式启动。

我尝试将它们放在 mime 配置部分内部和外部,两种方式都相同,但不确定我的loadmodule部分应该在文档中的哪个位置输入。

我不确定,但我唯一能看到的另一个问题是在我没有对其进行任何修改的 php.ini 文件中。

有人可以指出我正确的方向吗?我在这里缺少什么?

4

1 回答 1

0

编辑httpd.conf并添加(或删除;行首的):

# PHP 5.x module
LoadModule php5_module  modules/libphp5.so
AddHandler php5-script  .php 

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html   .php

# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps

我不知道,但我认为您需要重新启动 Apache。

来自http://dan.drydog.com/apache2php.html(第 11 步)

于 2012-08-26T01:02:00.107 回答