【发布时间】:2014-03-18 21:07:16
【问题描述】:
我想关闭 .htaccess 文件中的所有 php 错误。我尝试了以下 stackoverflow 问题。
Enabling error display in php via htaccess only
.htaccess 文件:
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_value error_log /home/petstail/public_html/PHP_errors.log
在我的 httpd.conf 文件中,我在虚拟主机中放置了类似的目录,
<Directory "/home/website/public_html">
Options All MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
错误日志:
Invalid command 'php_flag', perhaps misspelled or defined by a module not
included in the server configuration
但是,我仍然收到内部服务器错误 (500)。我该怎么办?我缺少什么配置?
谢谢。
【问题讨论】:
-
你重启服务器了吗?
-
首先检查您的 Apache error.log 以了解为什么会出现 500。
-
请检查我的编辑..
-
PHP 是作为 Apache 模块安装的吗?
-
php_value 和 php_flag 在大多数 Apache 服务器中是强烈反对的,并且通常会给出 500 错误。它们属于 php.ini 文件(您可能必须创建),语法略有不同。