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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:48:54+00:00 2026-05-12T07:48:54+00:00

Let’s say I’m basically inheriting a live site that has a lot of errors

  • 0

Let’s say I’m basically inheriting a live site that has a lot of errors in production, I’m basically doing a recode of this entire site which might take a month or so.

There are some cases in which this site was reliant upon external xml file feeds which are no longer there, but the code wasn’t properly setup to supply a nice clean error message ( there are various similar circumstances ) – the client is requesting that at least these error messages go away even if for example the content from the xml file isn’t published so we wouldn’t be seeing php errors and a blank region on the page ( so the rest of the page can look “fine” ).

At one point I have heard of someone using set_error_handler to nullify some cases where it isn’t extreme and I had the idea of setting it up to store error messages in a file/log or email them ( and try to not have duplicate error messages ) basically so end users don’t have to see those ugly things.

I’m looking for tips from anyone who’s actually done this, so thanks in advance.

  • 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-12T07:48:54+00:00Added an answer on May 12, 2026 at 7:48 am

    When in development, it is good to use

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    

    So you can see errors immediatly : it helps correcting them.

    When on the production server, you don’t want error displayed, so :

    ini_set('display_errors', 'Off');
    

    error_reporting can remain activated : if display_errors is Off, errors won’t be displayed anyway — but you can still have them logged to a file.

    BTW, those can be set in the php.ini file, of course :

    • error_reporting
    • display_errors

    On the production machine, you might want to use log_errors and error_log, so errors are logged to a file (which means you will be able to know what errors occured — can be useful, sometimes) ; of course, don’t forget to check that file from time to time ;-).

    As a sidenote, if you just have a couple functions/methods you don’t want to display errors, you could envisage using the @ operator to just mask the errors those might trigger…

    … But I strongly advise against it (except in very specific cases) : it make debugging lots harder : errors triggered there are never displayed, not even on your development machine !

    In my opinion, it is way better to just disable display_errors on the production machine ; it also means no error will be displayed at all, which is better for users!

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

Sidebar

Related Questions

Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let me try to explain what I need. I have a server that is
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>
Let's say I have a drive such as C:\ , and I want to
Let's aggregate a list of free quality web site design templates. There are a

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.