I am new to PHP and trying to understand how to debug the code. I am using the ini_set
and ini_get
functions.
Here's my code:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('log_errors_max_len', 0); // 0 = unlimited length
ini_set('error_log', '/var/www/html/debugging/php_errors.log');
echo $error->abc; // should give error
// E_ERROR - run out of memory
ini_set('memory_limit', '1K');
var_dump((object) range(0, 100000));
require 'abc.php';
?>
All the errors get logged into the php_errors.log file as well are displayed on the browser. But when I use var_dump((object) range(0, 100000));
to introduce a fatal error to run out of memory, I get a blank screen on the browser, whereas the error gets logged into the php_errors.log.
Do I need to change any other setting to get the error displayed on the browser as well as log into the file. I am just trying to play with PHP here.