User login

Increase PHP allowed memory size limits

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-limits-so-you-can-use-drush
http://agaricdesign.com/note/ghop-patch-modules-page-which-shows-how-much-memory-use
http://agaricdesign.com/increasing-php-file-upload-limits-capabilities-is-another-matter

Resolution

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

Comments

Did not get anything from

Did not get anything from your post.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.