Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7746643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:19:51+00:00 2026-06-01T10:19:51+00:00

We currently have an error catching script for all our PHP sites. This script

  • 0

We currently have an error catching script for all our PHP sites. This script uses a combination of set_error_handler & register_shutdown_function to catch all errors that occur including Memory exhaustion errors then sends us an email so that we can respond and fix the error.

Unfortunately in case of memory exhaustion errors the script has no more memory and can’t complete sending the email. I’ve tried updating the memory limit in the error handler function so the script can complete the error but this doesn’t seem to work. Is there a way to force PHP to dump it’s memory so that there is enough to send the error email? Or perhaps to detect and unset the largest memory items?

EDIT:
I should clarify that I’m using PHPMailer to send an email. I’m looking into using just mail in the case of a memory exhaustion error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:19:52+00:00Added an answer on June 1, 2026 at 10:19 am

    Looks like if I check for the exhaustion error and just use mail(), and don’t create any variables, at the very top of the error_handler then PHP will send an email with no issue.

    I also have to be sure to preset anything that I wish to include in the email with the exception of anything passed to the error handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have page where a PHP script echoes out all of my HTML
Currently I have create a website using codeigniter. I got a message error every
I have a PHPUnit test suite that is currently causing a fatal error due
We currently have a specific format for how our email addresses are defined, based
I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
This error has been driving me nuts. We have a server running Apache and
We currently have a classic asp 404 error page. By default, it's returning a
I have this image proxy. It worked fine in PHP 4 but not that
Currently have password protection on my main and sub directories, however I'd like to
I currently have 4 textboxes which will be used to store an ip address.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.