<?php
error_reporting(E_ALL); // Error/Exception engine, always use E_ALL
ini_set('ignore_repeated_errors', FALSE); // always use TRUE
ini_set('display_errors', FALSE); // Error/Exception display, use FALSE only in production environment or real server. Use TRUE
ini_set('log_errors', TRUE); // Error/Exception file logging engine.
ini_set('error_log', '/tmp/php_errors.log'); // Logging file path
echo ('test');
ehco('test');
?>
没有写入/tmp/php_error.log... 这令人沮丧,因为即使在 php.ini 文件中也是
<块引用>error_log = /tmp/php_errors.log
和 /tmp 上的 ls -al
<块引用>-rwxrwxrwx 1 apache 员工 0 Mar 17 16:20 php_errors.log