For convenience, i'm used to read/empty error log from an url in my browser
domain.com/wp-content/custom/read-error-log.php
`$logfile = dirname( DIR, 3 ) . '/logs/error.log';
$log = file_get_contents( $logfile );
echo '<h1>PHP 8.2 Error Log</h1>';
echo '<pre>';
print_r( $log );
echo '</pre>';`
But since log file is in /var/www/nginx/ i can't access and get this error:
"PHP message: PHP Warning: file_get_contents(): open_basedir restriction in effect. File(/var/www/domain.com/logs/error.log) is not within the allowed path(s): (/var/www/:/usr/share/php/:/tmp/:/var/run/nginx-cache/:/dev/urandom:/dev/shm:/var/lib/php/sessions/) in /var/www/domain.com/htdocs/wp-content/custom/ver-errorlog.php on line 13;"
Is there a way to access error.log like this without compromising security by messing with open_basedir