FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-30-2010, 10:47 PM
Alexander Farber
 
Default Redirecting PHP error messages into a log file

Hello,

I'm using CentOS release 5.5 x86_64 with the stock php-5.1.6-27.el5
and would like to redirect PHP messages into /var/log/httpd/php_log

First I tried adding that file name to /etc/php.ini:
error_log = "/var/log/httpd/php_log"
and restarted httpd, but the file didn't appear.
I've touched it and changed owner to apache.apache,
but that didn't help.

Then I've changed that line to error_log = syslog
and now I get the messages in /var/log/messages:

Jul 29 21:29:24 hXXX httpd: PHP Notice:
Undefined index: REMOTE_ADDR in
/var/www/html/odnoklassniki/index.php on line 44
Jul 29 21:29:45 hXXX httpd: PHP Parse error:
syntax error, unexpected '[' in
/var/www/html/odnoklassniki/index.php on line 44

I still would like to move those message to a separate file
though, so I've added the following line to /etc/syslog.conf
and reloaded syslogd service:

httpd.* /var/log/httpd/php_log

but the file is still empty. Any hints please?

Thank you
Alex

--
http://preferans.de
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-30-2010, 10:48 PM
"Jason Pyeron"
 
Default Redirecting PHP error messages into a log file

> -----Original Message-----
> From: centos-bounces@centos.org
> [mailto:centos-bounces@centos.org] On Behalf Of Alexander Farber
> Sent: Friday, July 30, 2010 18:47
> To: CentOS mailing list
> Subject: [CentOS] Redirecting PHP error messages into a log file
>
> Hello,
>
> I'm using CentOS release 5.5 x86_64 with the stock
> php-5.1.6-27.el5 and would like to redirect PHP messages into
> /var/log/httpd/php_log
>
> First I tried adding that file name to /etc/php.ini:
> error_log = "/var/log/httpd/php_log"
> and restarted httpd, but the file didn't appear.
> I've touched it and changed owner to apache.apache, but that
> didn't help.
>
> Then I've changed that line to error_log = syslog and now I
> get the messages in /var/log/messages:
>
> Jul 29 21:29:24 hXXX httpd: PHP Notice:
> Undefined index: REMOTE_ADDR in
> /var/www/html/odnoklassniki/index.php on line 44 Jul 29
> 21:29:45 hXXX httpd: PHP Parse error:
> syntax error, unexpected '[' in
> /var/www/html/odnoklassniki/index.php on line 44
>
> I still would like to move those message to a separate file
> though, so I've added the following line to /etc/syslog.conf
> and reloaded syslogd service:
>
> httpd.*
> /var/log/httpd/php_log
>
> but the file is still empty. Any hints please?

Selinux issue?

>
> Thank you
> Alex
>
> --
> http://preferans.de
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-30-2010, 10:57 PM
Alexander Farber
 
Default Redirecting PHP error messages into a log file

So you think the "httpd.*" line in syslog.conf is correct?

On Sat, Jul 31, 2010 at 12:48 AM, Jason Pyeron <jpyeron@pdinc.us> wrote:
>> -----Original Message-----
>> I still would like to move those messages to a separate file
>> though, so I've added the following line to /etc/syslog.conf
>> and reloaded syslogd service:
>>
>> httpd.* /var/log/httpd/php_log
>>
>> but the file is still empty. Any hints please?

> Selinux issue?
>
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 02:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org