Agaric Design Collective

Increase PHP allowed memory size limits

Average: 4 (1 vote)
By Benjamin Melançon
on 17 Dec
0 comments

Key words and phrases

php resource memory limit white screen of death Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4104 bytes)

Tags

Description

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 842489 bytes) in /var/www/wsf2008/includes/database.mysql.inc on line 380

If you have control of your own host:

ben@server:~$ sudo vi /etc/php5/apache2/php.ini

/Resource Limits plus RETURN to search
i to edit

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

max_execution_time = 60     ; Maximum execution time of each script, in seconds
max_input_time = 120 ; Maximum amount of time each script may spend parsing request data
memory_limit = 64M      ; Maximum amount of memory a script may consume (16MB)

ben@server:~$ sudo /usr/sbin/apache2ctl graceful

Note: In addition to the "Fatal error: allowed memory size" message, on one occasion Agaric received this warning about MySQL tables, presumably a result of PHP hitting its RAM limits.

Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'Table 'sessions' was not locked with LOCK TABLES\nquery: SELECT sid FROM sessions WHERE sid = '66cf5f25d1de4f2960aab066f81191dd' in /var/www/wsf2008/includes/database.mysql.inc on line 172.', 2, '', 'http://wsf.grassrootsconnection.org/eng/admin/build/modules/list/confirm', 'http://wsf.grassrootsconnection.org/eng/admin/build/modules', '209.6.110.123', 1197888951) in /var/www/wsf2008/includes/database.mysql.inc on line 172

Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'Table 'sessions' was not locked with LOCK TABLES\nquery: INSERT INTO sessions (sid, uid, cache, hostname, session, timestamp) VALUES ('66cf5f25d1de4f2960aab066f81191dd', 1, 0, '209.6.110.123', 'og_last|N;language|s:3:\\"eng\\";form|a:3:{s:32:\\"a5ffe3926e304c9dcf00ed203cc81efb\\";a:2:{s:9:\\"timestamp\\";i:1197878966;s:4:\\"args\\";a:1:{i:0;s:14:\\"system_modules\\";}}s:32:\\"0a606cf6f4bca0829e24c6392856bb27\\";a:2:{s:9:\\"timestamp\\";i:1197879462;s:4:\\"args\\";a:1:{i:0;s:14:\\"system_modules\\&am in /var/www/wsf2008/includes/database.mysql.inc on line 172

See also:
http://agaricdesign.com/note/upping-memory-command-line-php-memory-limit...
http://agaricdesign.com/note/ghop-patch-modules-page-which-shows-how-muc...
http://agaricdesign.com/increasing-php-file-upload-limits-capabilities-i...

 

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.