I would like to save all error_reporting’s notices into a file so that it can be read easily.
I’m using CLI to run my PHP script. The notices are outputs all at once, and as you already know, the console’s scroll-bar position just can be moved to the topmost place for me to read notices there.
Pipe the console output to a file using the redirection operator >. For example, when I run my php scripts on the console, I type
To redirect the console output to a file, I could type
The console output then goes to out.txt instead of the screen.