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 7851159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:05:59+00:00 2026-06-02T19:05:59+00:00

How can I catch all application exceptions and PHP errors in production environment? I

  • 0

How can I catch all application exceptions and PHP errors in production environment?

I am using a custom MVC framework, and I have a entry point where my MVC framework starts. So I already wrap this entry point with a general:

 try{
    //start point of mvc framework that load main class 
    //that manage request, response, route etc
 }catch(Exception $e) {
    //return response 404 to client if something goes wrong
 }

Is this enough? What about PHP errors?

It’s a production environment so I don’t the users to see the errors, but I want to log all for debugging. Is there an opensource PHP class that log errors in a elegant way that I can inspire from?

  • 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-02T19:06:01+00:00Added an answer on June 2, 2026 at 7:06 pm

    Nope, an exception handler is not enough. You should also transform php notices/errors/warnings into exceptions so that you can catch them as well, I have an example here: http://codehackit.blogspot.com/2012/01/php-errorswarningsnotices-to-exceptions.html Unfortunately most of PHPs built in functions still don’t throw exceptions but these couple lines fix that 😉

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

Sidebar

Related Questions

I've been developing big applications using try/catch to handle all the exceptions and errors;
We know that we can catch any unexpected exception at application level by using
I have an ASP.NET MVC 2 application with a custom StructureMap controller factory to
In Java, we handle exceptions using try catch blocks. I know that I can
I'd like to have something like a catch-all for exceptions thrown from a inside
how can I catch all strings from a native windows .exe file and replace
Is there any addon by which I can disable all catch blocks temporarily. I'm
I have been hearing that with unit testing we can catch most of the
I've got an application, which uses Winsock 2.0 recv function, and I can catch
I would like to catch all unhandled exceptions in my UI app in C#,

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.