Setup: CentOS 6.6, Apache 2.2.15, php 5.5.21
I 'm building a php script that displays the content of the
/var/log/httpd/error_log file. Unfortunately, it does not work. The error message states:
Permission denied in /var/www/domain.com/tools/server-logs-viewer.php on line 405
$f = fopen($filename, "rb");
I've chmoded 0777 the file, just to check, still no-go. So I assume the message refers to file ownership. The log file is owned by root:root whereas the php script is owned by apache:apache.
What can I do to give apache enough read access to the file, without compromising the error reporting process ?