Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Apache error log filles with PHP errors

Locked
anorman
Posts: 66
Joined: Wed Apr 04, 2012 11:34 pm

Apache error log filles with PHP errors

Unread post by anorman »

Hello,

This probably is nothing to be concerned about, but I want to verify it.

I just created a brand new installation (Windows 7) as well to check that my production system (CentOS Linux 6) isn't "broken", and both behave the same way.. I am using v2.7.1 (7-6-12).

Logging into any database (including sample and samplefinancial) gives me these errors in the apache error log on just about every page I request..

[Sun Jul 08 15:12:31 2012] [error] [client 192.168.222.93] PHP Notice: Undefine
d variable: _SESSION in /var/www/html/productionnu2/common.php on line 746, refe
rer: http://192.168.222.92/productionnu2/for ... =db/sample
nufinancial&ses=14ff9db6dbccca&tab=0

I get an error entry for lines 746 thru line 752 which corrosponds to the following in common.php

745 //-- add session variables
746 $a['#zzsys_session_id#'] = $_SESSION['nu_session'];
747 $a['#access_level#'] = $_SESSION['nu_access_level'];
748 $a['#zzsys_user_id#'] = $_SESSION['nu_user_id'];
749 $a['#zzsys_user_group_name#'] = $_SESSION['nu_user_group'];
750 $a['#session_id#'] = $_SESSION['#nu_session#'];
751 $a['#ses#'] = $_SESSION['#nu_session#'];
752 $a['#session_parameter#'] = $a['#parameter#'];
753
754 return $a;
755 }


I used the windows installer method for the windows install, so everything is set up automatically. It does it also, so I assume that this is not really a problem? But, it creates massive error_log files as these errors are repeated over and over again for just about every page hit..

Thanks,
- Andre
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Apache error log filles with PHP errors

Unread post by admin »

Andre,

They dont matter, php is jumping up and down because theses array variable haven't been predefined.

Steven
danielf
Posts: 44
Joined: Tue Jul 26, 2011 2:48 pm

Re: Apache error log filles with PHP errors

Unread post by danielf »

Funnily enough, I was just looking at this today. I too am getting masses of 'undefined index' etc notices and errors in the apache error log.

I'm sure someone will answer regarding whether or not it is an actual problem, but I concur that the size of the error logs can be problematic. I have one site that runs on a local host (so not web-based), and it has created an error log of several gigs over a two month period.

I have found two workarounds: one is to rotate the error log, using Apache's rotatelogs. This allows you to start a new error log when the log file exceeds a particular size (or after a set time period). The problem with this workaround (for me), is that there doesn't seem to be a way to set the number of archives that are kept (at least with rotatelogs, which appears to be the only Windows option), so you need to either manually delete older log files, or write a script to do it for you.

A second workaround, which seems to work better, is to change the Apache error reporting in httpd.conf (which is also where you need to apply the log rotation). The standard log level is 'warn', which will include warnings in the error log. You can set this to something more stringent (e.g. crit, for critical errors). Setting it to crit pretty much cuts all the above error messages, and stops the error log from growing to monstruous sizes. However, while this seems to do the job, I'm not sure if altering the report criterion is actually a wise thing to do. If anyone could comment on that, I'd be most grateful.
danielf
Posts: 44
Joined: Tue Jul 26, 2011 2:48 pm

Re: Apache error log filles with PHP errors

Unread post by danielf »

Oh. I just noticed the 'access thread'. The solution given there (change the php error reporting) solves this problem. Presumably, it's preferable to change error reporting in php rather than Apache, as the error messages are generated by php?
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Apache error log filles with PHP errors

Unread post by admin »

.
Locked