I'm having trouble opening MySQL's slow query log with PHP. I'm writing a debugger and trying to tap into the log file but it's giving me a permission denied message.
Code:
$log = file_get_contents('/var/log/mysql/mysql-slow.log');
Response (error):
Warning: file_get_contents(...): failed to open stream: Permission denied ...
I can cat
the file just fine from a terminal. I've chmoded the log file to 0777 with the same result. Is this operation not allowed while MySQL is running? Are there ways around this?
PHP5.2.10, Ubuntu 9.10, MySQL 5.1.37