Obtaining PHP logs?

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
jnojr
Posts: 133
Joined: 2007/11/29 23:42:03
Location: San Diego, CA
Contact:

Obtaining PHP logs?

Post by jnojr » 2008/11/05 22:07:38

I have a CentOS 5 system with:

[root@wikisrv-01 wiki]# rpm -q httpd
httpd-2.2.3-11.el5_1.centos.3
[root@wikisrv-01 wiki]# rpm -q php
php-5.1.6-15.el5

I want to troubleshoot a PHP problem, and am trying to get PHP logs.

In php.ini, I have:

log_errors = On
error_reporting = E_ALL
error_log = /var/log/php.log

I touched /var/log/php.log, chowned it to apache, and restarted httpd But nothing is being written to /var/log/php.log or /var/log/httpd/error_log or anywhere else that I can find. What do I need to do to get PHP logs?

mickh
Posts: 124
Joined: 2008/02/15 09:42:43
Location: Australia

Re: Obtaining PHP logs?

Post by mickh » 2008/11/05 23:44:57

Have a look at the apache logs (/var/www/logs/httpd/error_log), I can usually find any PHP errors listed in there.

Update: sorry, I now see you've already looked there!

saman_artorious
Posts: 73
Joined: 2008/09/19 19:03:37

Re: Obtaining PHP logs?

Post by saman_artorious » 2008/11/06 13:48:52

You do not need to modify the error_log option path, just leave the way it is

; Log errors to specified file.
;error_log = filename

all php errors are written to the error_log file in

/etc/httpd/logs/error_log

by default

Post Reply