Show Timeline link causes error in 1.24.1

Forum for questions and support relating to the 1.24.x releases only.
Post Reply
acrohymn
Posts: 3
Joined: Tue Apr 28, 2009 8:20 am

Show Timeline link causes error in 1.24.1

Post by acrohymn » Tue Apr 28, 2009 8:32 am

Hi there can anyone explain how to over come this issue.

When I have a large event and click show timeline I get the following error:-

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 77 bytes) in /var/www/includes/database.php on line 125

I'm sure it is simple to increase memory some where but being a newby I'm not sure where or what.

Many thanks, John

User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle
Contact:

Post by cordel » Tue Apr 28, 2009 11:56 am

Likely you need to increase your memory setting for php in you php config. Should be /etc/php.ini if not you'll have to search to locate it.

lorsungcu
Posts: 23
Joined: Mon Jun 23, 2008 3:56 pm

Post by lorsungcu » Mon Jan 04, 2010 4:04 pm

I have the same issue, but increasing the size does not change anything. Now zoneminder wont load at all; here's the error I'm getting:

Code: Select all

Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 7680 bytes) in /usr/share/zoneminder/includes/database.php on line 147
Tried everything between 16M and 512M, nothing changed that error. Nothing sinister in the apache error logs. What/where should I be looking?
Last edited by lorsungcu on Mon Jan 04, 2010 6:17 pm, edited 1 time in total.

JohnnyLaww
Posts: 20
Joined: Sun Sep 23, 2007 1:46 am

agree with cordel

Post by JohnnyLaww » Mon Jan 04, 2010 5:29 pm

I have to agree with cordel, this is a php configuration issue.

You need to edit your php.ini file and add/modify the following setting:

Code: Select all

memory_limit = 32M 
Most likely it is currently set to 16M or possibly even 8M depending on your OS and PHP version installed. As to where your php.ini file is located, again that will depend on which distro you have installed.

If you don't have access to your php.ini (ie, you are on a shared hosting provider) you can accomplish the same through an .htaccess setting:

Code: Select all

php_value memory_limit 32M
Hope this helps..

lorsungcu
Posts: 23
Joined: Mon Jun 23, 2008 3:56 pm

Post by lorsungcu » Mon Jan 04, 2010 5:37 pm

Johnny - as stated, I've changed it to everything from 16M to 512M with no difference in outcome, I continue to get the fatal error. Here are the results of 'locate php.ini':

Code: Select all

/etc/php5/apache2/php.ini
/usr/share/doc/php5-common/examples/php.ini-dist
/usr/share/doc/php5-common/examples/php.ini-paranoid
/usr/share/doc/php5-common/examples/php.ini-recommended
/usr/share/php5/php.ini-dist
/usr/share/php5/php.ini-dist.cli
I've tried changing all 3 (-dist, -dist.cli) values with no affect. Returning them to their defaults doesn't change anything, either. Here is the relevant bit of my php.ini file, am I missing something?

Code: Select all

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 512M ; Maximum amount of memory a script may consume (16MB)
Like I said, I've tried 32M, tried 64, tried 96, 128 etc - nothing changes. I've reloaded apache, mysql and zm between each change. I've restarted the machine between some changes, no effect. I must be doing something wrong, but I dont know what.
Last edited by lorsungcu on Mon Jan 04, 2010 6:17 pm, edited 1 time in total.

JohnnyLaww
Posts: 20
Joined: Sun Sep 23, 2007 1:46 am

PHP error

Post by JohnnyLaww » Mon Jan 04, 2010 5:57 pm

Okay,

I am pretty certain you will want to edit the php.ini located here:
/etc/php5/apache2/php.ini

Since you have already done so, lets verify that the changes have indeed been accepted.

Somewhere in your www root create a file called info.php
Insert this code:

Code: Select all

<?php phpinfo(); ?>
Now browse to this file in IE or FF or whatever browser you are using.

Post the results here if you can, but more importantly verify the memory_limit settings.

John

lorsungcu
Posts: 23
Joined: Mon Jun 23, 2008 3:56 pm

Post by lorsungcu » Mon Jan 04, 2010 6:08 pm

Here are the bits that matter, let me know if you'd like to see something else:

Code: Select all

System = Linux arccctv 2.6.31-16-server #53-Ubuntu SMP Tue Dec 8 05:08:02 UTC 2009 x86_64 

Loaded Configuration File = /etc/php5/apache2/php.ini 

additional .ini files parsed = /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini 

memory_limit = 512MB	512MB  (local / master values)
I'll go through the addition ini's and see if anything looks pertinent.

lorsungcu
Posts: 23
Joined: Mon Jun 23, 2008 3:56 pm

Post by lorsungcu » Mon Jan 04, 2010 6:21 pm

Reloaded apache again, didn't change anything, and it came back to life...going to try loading a large timeline view to see if i can make it break....

Timeline just loaded with 10k+ events. Seems to have fixed it, although I dont know what I did. Is upping the PHP memory limit the best solution? Am I going to break something else because that's so high now?

JohnnyLaww
Posts: 20
Joined: Sun Sep 23, 2007 1:46 am

Post by JohnnyLaww » Mon Jan 04, 2010 6:52 pm

No, you should be fine, although 512M is a little overkill. You could be okay lowering it but seeing as how it's working now, you might as well just leave her alone.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests