首页 > 解决方案 > 通过 .htaccess 设置日志目的地

问题描述

我想通过 .htaccess 设置错误日志目标

目录

michael@michael:/var/www/html$ ls -la
total 1492
drwxr-xr-x 2 root    root       4096 дек  9 14:08 .
drwxr-xr-x 3 root    root       4096 сен 13 15:23 ..
-rw-r--r-- 1 root    root        153 дек  9 14:08 2.php
-rw-r--r-- 1 root    root        235 дек  9 14:08 .htaccess

.htaccess

DirectoryIndex index.php

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off

# enable PHP error logging
php_flag  log_errors on
php_value error_log  /var/tmp/PHP_errors.log

2.php

<p>Test</p>

<?php
   phpinfo();
   $message = "Trololo";
   $destination = "/var/tmp/my-errors.log";
   error_log ( $message, 3,  $destination );
?> 

结果:当我输入 URL http://localhost/2.php 时,在显示的 php 设置中:

error_log    no value

错误日志:没有值

我可以做些什么来调查这个问题?

标签: phpapache

解决方案


推荐阅读