PHP Apache没有运行

时间:2011-06-01 04:11:06

标签: php apache freebsd

我正在尝试安装phpldapadmin。我已经安装了代码并将其放在我的文档dir for apache中我还将php5模块加载到apache config中并添加了以下目录指令。

<Directory "/usr/local/www/apache22/data/phpldapadmin/htdocs">
    DirectoryIndex index.php
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
    AddType application/x-httpd-php .php
</Directory>

然而,当我浏览浏览器时,只需显示index.php中的php代码,我们将非常感谢您的帮助。

添加此行AddType application / x-httpd-php .php无效。还要重启服务器。

2 个答案:

答案 0 :(得分:4)

<Directory></Directory>内添加此行:AddType application/x-httpd-php .php .phtml 这使您的PHP脚本由PHP解释器执行。

(并记住重新启动服务器。如果你不知道如何重新启动计算机)

http://www.php.net/manual/en/install.unix.apache.php

答案 1 :(得分:2)

尝试重新启动服务器以使配置文件更改生效。