当display_errors关闭时,我有php错误

时间:2018-12-29 12:33:41

标签: php apache fpm

我在页面上显示以下几个php错误:Notice: Undefined index 我有/etc/php/5.6/fpm/php.inidisplay_errors = Off

将值设置为On时,我会在页面上发现更多错误。

我的htaccess文件为空,vHost conf为:

<VirtualHost *:80>
        ServerName website1.tld
        DocumentRoot /home/website1

        ErrorLog /var/log/sites/ website1_error_log
        CustomLog /var/log/sites/ website1_access_log combined

        DirectoryIndex index.php index.html index.htm index.php4 index.php5

        <Directory /home/website1>
                Options -Indexes +FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>
        <FilesMatch \.php$>
                SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/"
        </FilesMatch>
        RewriteEngine on
</VirtualHost>

谢谢

1 个答案:

答案 0 :(得分:0)

您不必在此/etc/php/5.6/fpm/php.ini中进行任何更改。您可以在应用程序/文件的顶部放置error_reporting(0)。

<?php
// Turn off error reporting
error_reporting(0);