How to display php error on the web page

by toy

Has anybody been curious about why my error on .php file is display on error_log in apache2? Why my error doesn’t print on the screen. So that I don’t have to go to the error_log and tail all the time. Or it’s just me. I am a total newbie in PHP and apache2.

Here’s the thing.

Put that code on top of your first php file and the scariest thing will appear on your screen

1
2
ini_set('display_errors', 1);
ini_set('log_errors', 1);