You are not logged in.
Hi all,
Having a problem with PHP on Apache and not being able to get logs out. My php.ini is logging to syslog:
root ~ # grep '^error_log' /etc/php/php.ini
error_log = syslog
root ~ #
And syslog-ng is setup as so:
root ~ # grep php /etc/syslog-ng.conf
destination php { file("/var/log/php.log"); };
filter f_php { program("^php"); };
log { source(src); filter(f_php); destination(php); };
root ~ #
I've also tried replacing program("^php"); with match("php"); but to no avail
I have a test page on my webserver which should throw an error:
root ~ # cat /home/fukawi2/public_html/test.php
<?php
echo "Moo"
?>
(No ; to end the echo statement)
When I access this page via my web browser, it prints "Moo", but no error is written to /var/log/php.log
I restart syslog-ng after any change I make to the conf file.
What am I doing wrong?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
What about error_reporting level and log_errors = On ?
Offline
root ~ # egrep '^error_reporting |^log_errors ' /etc/php/php.ini
error_reporting = E_ALL
log_errors = On
root ~ #
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Can you log to a file without going through syslog i.e. error_log = filename? If so, then I guess the problem is with syslog...
Offline
I actually suspected it was syslog-ng, but it appears not...
root ~ # grep "^error_log" /etc/php/php.ini
error_log = /tmp/php.log
root ~ # touch /tmp/php.log
root ~ # chmod 777 /tmp/php.log
root ~ # /etc/rc.d/httpd restart
:: Stopping HTTP Daemon [DONE]
:: Starting HTTP Daemon [DONE]
root ~ #
I then accessed my test error page, but....
root ~ # cat /tmp/php.log
root ~ #
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
El bumpo... Anyone?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
I am puzzled. What if you set log_error=off so that errors are displayd on the web page instead...:/
Offline
root ~ # grep '^log_errors' /etc/php/php.ini
log_errors = Off
log_errors_max_len = 1024
root ~ # /etc/rc.d/httpd restart
:: Stopping HTTP Daemon [DONE]
:: Starting HTTP Daemon [DONE]
www/~fukawi2/test.php
Moo
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
What about setting display_errors = On ( that should show them on the browser)
And throw in a display_startup_errors = On while we are there....
Offline
display_errors was already on, and display_startup_errors had no effect. Same as my last post
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
did you ever get this to work?
I had a similar problem and found that changing error_log to a local file in php.ini did the trick.
By the way, your test file didn't show an error on my system either, just said 'Moo'. But calling a nonexistent function logged the error.
Offline
Yes
http://www.linuxquestions.org/questions … ost3201264
Once I fixed my error-generating test, it logs properly now
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline