PHP error_log 不起作用

PHP error_log 不起作用

我正在使用 slim 框架,并且已将其添加error_reporting(E_ALL);到我的 public/index.php 文件的第一行。

我正在使用 apache2 和 Ubuntu 18。

这是配置文件

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /pathtoproject/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    php_flag log_errors on
        php_flag display_errors on
    php_flag display_startup_errors on
        php_value error_log ${APACHE_LOG_DIR}/php_errors.log
    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
    <Directory "/pathtoproject/public">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride all
                Require all granted
                <IfModule mod_rewrite.c>
                        RewriteEngine on
                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
                </IfModule>
        </Directory>
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

这就是我的 phpinfo 的样子

在此处输入图片描述

我的错误日志文件权限

-rwxrwxrwx  1 www-data www-data     0 Dec  6 20:36 php_errors.log

相关内容