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

  • Home
  • SEARCH
  • 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 7017255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:53:26+00:00 2026-05-27T22:53:26+00:00

I am currently working on a PHP/MySQl application. A 500 error is thrown if

  • 0

I am currently working on a PHP/MySQl application. A 500 error is thrown if there is an error where by the application cannot recover and cannot continue executing:

  • Could not connect to the database.
  • Running out of disk space
  • etc.

I would like to be emailed/smsed if such an error occurs. The problem is that I do not wish to be emailed everytime a 500 error is triggered. If the site is very busy, then in a short span of time, one can easily receive hundreds of emails or SMSes.

I thought about sending an email when the error first occurs, then setting a flag which prevents an email from being sent within the next 20 minutes. However this leads to another issue. If the flag is stored in the database, or in a file on the filesystem, then not being able to connect to the database or running out of disk space would make the flag useless.

There’s also the possibility that the SMTP server for sending emails might go down, but in that case, I don’t think anything can really be done, and an external monitoring service would be required.

Are there any better ways of doing this?

  • 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-05-27T22:53:27+00:00Added an answer on May 27, 2026 at 10:53 pm

    Nope, your solution is probably the best [simple] option. But do it with a pre-existing file. Create it somewhere on the filesystem so it exists even if space runs out. Use touch() to update the modification time every time a 500 error occurs. If the filemtime() was in the last [x] minutes, don’t send out the email.

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

Sidebar

Related Questions

I am currently working on a small sponsorship application(PHP/MySql) for my personal blog, and
I am currently working on a web application that uses PHP and MySQL, but
I'm currently working on a PHP application that uses a MySQL database for its
I'm working on a storefront application in PHP with MySQL. I'm currently storing my
I am currently working on a PHP application that puts me in the desperate
I'm currently working on an OO PHP application. I have a class called validation
I am working with multiple databases in a PHP/MySQL application. I have development, testing,
Well,I am learning the web development and currently working on PHP and mySQL ,I
I am working on a web-application in PHP-MySQL. I am MySQLi API for database
I'm currently working on a PHP/MySQL script that does the following, in this order:

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.