0

I'm updating to PHP 7.4.5 on Windows/IIS and obviously lost in configuration.

Suddenly script output isn't shown on any notice-warnings

<?php
$a = 'cat';

echo $a;
echo $b;

file_put_contents('debug.txt',date('H:i:s',time()));

just shows:

PHP Notice:  Undefined variable: b ..test2.php on line 5

Which is all fine, but I miss the cat.

Script is executed as debug.txt is updated.

enter image description here

Teson
  • 6,644
  • 8
  • 46
  • 69
  • Over CLI the warning showed twice (and cat). With help from https://stackoverflow.com/questions/9001911/why-are-php-errors-printed-twice it seems to be [log_errors] default to STDOUT that creates the problem. Solved with log_errors=Off – Teson May 20 '20 at 08:18
  • Does this answer your question? ["Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" using PHP](https://stackoverflow.com/questions/4261133/notice-undefined-variable-notice-undefined-index-and-notice-undefined) – Dharman May 23 '20 at 18:04
  • @Dharman, no not really. The problem what not the notice itself, but that any other output from the script was surpressed (but run). Adding my comment as solved in the question. – Teson May 25 '20 at 08:32
  • 1
    Do not edit your question with answer. Post it as regular answer and mark accepted. – Marcin Orlowski May 25 '20 at 08:38

1 Answers1

0

SOLVED

Over CLI the warning showed twice - and script output (cat). With help from Why are PHP errors printed twice? it's caused by [log_errors] set default to STDOUT that creates the problem. Solved with:

log_errors=Off
Teson
  • 6,644
  • 8
  • 46
  • 69