apache error log filling up with php errors

Forum for questions and support relating to the 1.24.x releases only.
Locked
BlankMan
Posts: 147
Joined: Tue Jan 19, 2010 2:53 am
Location: Milwaukee, WI USA

apache error log filling up with php errors

Post by BlankMan »

Getting a real lot, a real lot, of these in my apache error log. Any way to stop/correct this?

Code: Select all

[error] [client 0.0.0.0] PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in /<removed>/includes/functions.php on line 1412

[error] [client 0.0.0.0] PHP Warning:  strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in /<removed>/includes/functions.php on line 1412

[error] [client 0.0.0.0] PHP Deprecated:  Function split() is deprecated in /<removed>/skins/classic/views/options.php on line 193, referer: http://mywebsite/

[error] [client 0.0.0.0] PHP Deprecated:  Function ereg() is deprecated in /<removed>/includes/functions.php on line 808, referer: http://mywebsite/
[error] [client 0.0.0.0] PHP Deprecated:  Function ereg() is deprecated in /<removed>/includes/functions.php on line 813, referer: http://mywebsite/
[error] [client 0.0.0.0] PHP Deprecated:  Function ereg() is deprecated in /<removed>/includes/functions.php on line 818, referer: http://mywebsite/
[error] [client 0.0.0.0] PHP Deprecated:  Function ereg() is deprecated in /<removed>/includes/functions.php on line 823, referer: http://mywebsite/
[error] [client 0.0.0.0] PHP Deprecated:  Function ereg() is deprecated in /<removed>/includes/functions.php on line 828, referer: http://mywebsite/
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Post by Paranoid »

Find the php.ini file used for the apache php module. It in different places on different systems but you should be able to find it by executing:

find /etc -name php.ini

There should be a variable in there called "error_reporting". Make sure it is set as follows:

error_reporting = E_ALL & ~E_DEPRECATED

If it set like that then I think this is a bug either with php5 or the apache php5 module ignoring the error_reporting value. If that is the case then you can get rid of the strftime() message by going to the "[date]" section (in php.ini) and manually setting the timezone: eg:

Code: Select all

[date]
date.timezone = GMT
Restart apache if you modify the php.ini file.

The ereg messages will continue until the Zonemiinder php code is changed or the apache/php5 bug is fixed.

I've changed the code on my own setup but as I've never used php to program I'm not sure if I've just got rid of one problem only to introduce another one later.
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Post by Paranoid »

Actually, just thought I'd check and see if zoneminder sets the error_reporting variable and it does. This isn't a bug with either php5 of apache.

You can stop all the warnings by editing the zm/index.php. Look for a line like this:

error_reporting( E_ALL );

and change it to:

error_reporting( E_ALL ^ E_DEPRECATED );

The will stop all the depreciated warning messages.
BlankMan
Posts: 147
Joined: Tue Jan 19, 2010 2:53 am
Location: Milwaukee, WI USA

Post by BlankMan »

Thanks, the date.timezone = "US/Central" in the /etc/php5/apache2/php.ini (or maybe in the /etc/php5/cli/php.ini, did both) took care of that and the error_reporting( E_ALL ^ E_DEPRECATED ); in the index.php took care of the other (didn't help in the php.ini files). Much appreciated!
User avatar
dvarapala
Posts: 54
Joined: Sat Nov 06, 2010 2:30 pm

A Minor Tweak May Be Needed

Post by dvarapala »

This solution didn't quite work for me. When I changed the time zone to GMT, suddenly my monitors would no longer stream. The error messages in my log said that it had been selecting 'America/Los_Angeles' as the time zone, so I tried changing the date.timezone to PST. Now the warning messages are gone from the log and my streaming still works. Setting it to "America/Los_Angeles" also works. :)

I mention it in case anyone else runs into the same issue.
Locked