Answers.Body: <p>You need to increase your PHP memory limits. </p>
  
  <p>This is the recommended approach if you have access to the server's php.ini. This will not be possible in some shared hosting environments, though your host may be able to adjust it for you. Note that this change will affect all websites and PHP scripts on the server.</p>
  
  <p>Locate the php.ini file used by your web server. </p>
  
  <p>Edit the memory_limit parameter in the php.ini file (usually in a section called Resource Limits). Make sure you use M to specify the number of megabytes (not MB).
  memory_limit = 256M ; Maximum amount of memory a script may consume (256MB)
  If there is no section already for this, place the above line at the end of the file.</p>
  
  <p>Restart Apache.</p>
  
  <p>Credit: <a href="https://www.drupal.org/docs/7/managing-site-performance-and-scalability/changing-php-memory-limits" rel="nofollow noreferrer">https://www.drupal.org/docs/7/managing-site-performance-and-scalability/changing-php-memory-limits</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-22T15:34:41.280Z
Answers.LastActivityDate: 2017-11-22T15:34:41.280Z
Answers.UserDisplayName: Sleewok
Answers.Body: <p>For such issues you generally have two possibilities: increase the memory available to the process, or do things in smaller chunks.  You could try exporting the data in smaller batches.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-22T15:33:31.533Z
Answers.LastActivityDate: 2017-11-22T15:33:31.533Z
Answers.UserDisplayName: Aidan
Body: <p>I'm getting below error message while exporting csv file of 40k record. </p>
  
  <p>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65552 bytes) in /var/www/html/crf-git/modules/syslog/syslog.module on line 115. </p>
  
  <p>How to catch or handle this kind of error? </p>
  
  <p>Thanks &amp; Regards,
  Sachin</p>
  
Tags: <php>
Title: How to catch Fatal error in civicrm?
ThreadText: # How to catch Fatal error in civicrm?
  
  (Asked by: username_0 on 2017-11-22)
  
  I'm getting below error message while exporting csv file of 40k record.
  
  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65552 bytes) in /var/www/html/crf-git/modules/syslog/syslog.module on line 115.
  
  How to catch or handle this kind of error?
  
  Thanks & Regards,
  username_0
  
  **Tags:** php
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-11-22. Score: 1
  
  You need to increase your PHP memory limits.
  
  This is the recommended approach if you have access to the server's php.ini. This will not be possible in some shared hosting environments, though your host may be able to adjust it for you. Note that this change will affect all websites and PHP scripts on the server.
  
  Locate the php.ini file used by your web server.
  
  Edit the memory\_limit parameter in the php.ini file (usually in a section called Resource Limits). Make sure you use M to specify the number of megabytes (not MB).
  memory\_limit = 256M ; Maximum amount of memory a script may consume (256MB)
  If there is no section already for this, place the above line at the end of the file.
  
  Restart Apache.
  
  Credit: <https://www.drupal.org/docs/7/managing-site-performance-and-scalability/changing-php-memory-limits>
  
  
  ---
  
  ### Answer by username_2 on 2017-11-22. Score: 0
  
  For such issues you generally have two possibilities: increase the memory available to the process, or do things in smaller chunks. You could try exporting the data in smaller batches.
  
  
  ---
  
  