Apache2 php error logging

Jasper Frumau jasperfrumau at gmail.com
Sat Feb 6 23:19:55 PST 2010


On Sun, Feb 7, 2010 at 12:36 AM, Scott Haneda <talklists at newgeo.com> wrote:
>
> On Feb 6, 2010, at 12:16 PM, Jasper Frumau <jasperfrumau at gmail.com> wrote:
>
> On Sat, Feb 6, 2010 at 10:50 PM, Scott Haneda <talklists at newgeo.com>
wrote:
>>
>> You could probably nuke the script and redstart Apache, it should
recreate itself with the correct permission.
>> At least, that's exactly how my error and access logs behave. When I roll
them I essentilly move them, sleep apache, restart apache gracefully, and
gzip them. I've never had a log not recrete on lack of existance. Then
again, I've always sent php errors to the error log in Apache since the
errors often time are related, or helpful to see http data errors alongside.
>
> I guess I could do this as well. On some other shared hosts I work with
they do the same. Do I just adjust the path in php.ini and write PHP errors
to the same error.log as Apache writes its errors to?
>
> You know, I'm not sure. I always just leave the php.ini at default in that
setting and that is where it logs.
> Maybe load phpInfo(); and see if you can still see the default value.

Yeah well that is:

error_log/var/log/php-scripts.log/var/log/php-scripts.log

So that has already been changed by me in the php.ini .

>
> I believe your php logging levels, like E_* play a role here as to what
gets logged to screen/browser/stdout as well. More good info here:
> http://www.php.net/manual/en/function.error-reporting.php
> And also related to some of your other questions.
> http://php.net/manual/en/errorfunc.configuration.php

Checked that out before. More on PHP Error functions in php scripts than on
real configuration.

I checked http://php.net/log-errors and read details in php.ini itself


> If you move aside you php.ini and put a copy of php.ini(development), then
look at your phpIfo(); output, it will tell you.
> I suspect the log path is just commented ou in the ini default filet.

Yes, comment out, both in production and development inis:

$ cat php.ini-production | grep error_log
; server-specific log, STDERR, or a location specified by the error_log
; Set maximum length of log_errors. In error_log information about the
source is
;error_log = php_errors.log
;error_log = syslog
$ cat php.ini-production | grep error_log
; server-specific log, STDERR, or a location specified by the error_log
; Set maximum length of log_errors. In error_log information about the
source is
;error_log = php_errors.log
;error_log = syslog

And here as I use it:

$ cat php.ini | grep error_log
; server-specific log, STDERR, or a location specified by the error_log
; Set maximum length of log_errors. In error_log information about the
source is
error_log = /var/log/php-scripts.log
;error_log = syslog



> You could skip the loading of the php.ini and if your cool with diff or
grep, just compare the ini sample files MacPorts installed.

I use grep as a search tool, but have not used it to compare yet. Never used
diff. Will check them out asap..
> php.ini for me, sends logging to Apache's error_log. It always has.

Yes, well do I understand that commenting it out will send it the Apache
error log?

http://lists.macosforge.org/pipermail/macports-users/2007-September/005668.htmlseems
to indicate that ..

Sidenote: I still have a white screen of death in
opt/local/apache2/htdocs/folder/ The error reporting is turned of, logging
turned on but no new errors reported...


> When I get back to my computer and off my phone I will confirm.
> --
> Scott
> (Sent from a mobile device)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20100207/2f2a7327/attachment.html>


More information about the macports-users mailing list