diff --git a/ext/log_console/main.php b/ext/log_console/main.php index 46bd99b8..a3ccbc54 100644 --- a/ext/log_console/main.php +++ b/ext/log_console/main.php @@ -82,8 +82,10 @@ class LogConsole extends Extension } if (!defined("UNITTEST") && PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { $fp = fopen("/dev/tty", "w"); - fwrite($fp, $str); - fclose($fp); + if($fp) { + fwrite($fp, $str); + fclose($fp); + } } } }