I created a PHP script to read the error log file in a customized visual format, but right now, I have the path to the error log file hard-coded in, which works fine for me, but I would like to find out if there’s a way to pull the path to the error_log automatically so it can work on any server without further configuration.
Share
You can use ini_get to obtain the error_log path in PHP.
Otherwise, you’d be relegated to using something like:
Note that if there is no error_log set,
$error_logwill return: