Questions tagged [error-reporting]

424 questions
1836
votes
28 answers

How do I get PHP errors to display?

I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL. I have restarted my Apache webserver. I have even put these lines at the top of my script, and it doesn't even catch simple parse errors. For…
Abs
  • 51,038
  • 92
  • 260
  • 394
250
votes
12 answers

Remove warning messages in PHP

I have some PHP code. When I run it, a warning message appears. How can I remove/suppress/ignore these warning messages?
Alireza
  • 4,901
  • 9
  • 34
  • 48
178
votes
26 answers

How to get users to read error messages?

If you program for a nontechnical audience, you find yourself at a high risk that users will not read your carefully worded and enlightening error messages, but just click on the first button available with a shrug of frustration. So, I'm wondering…
F'x
  • 11,555
  • 6
  • 67
  • 120
130
votes
0 answers

PHP's white screen of death

Now that I'm starting to get back into PHP, I'm starting to remember why I gave it up in the first place. The most annoying thing on my plate at the moment is what I've come to term "PHP's white screen of death". When PHP gets a fatal error due to…
Matthew Scharley
  • 115,776
  • 51
  • 189
  • 215
127
votes
1 answer

mysqli_fetch_assoc() expects parameter / Call to a member function bind_param() errors. How to get the actual mysql error and fix it?

In my local/development environment, the MySQLi query is performing OK. However, when I upload it on my web host environment, I get this error: Fatal error: Call to a member function bind_param() on a non-object in... Here is the code: global…
siopaoman
  • 1,423
  • 2
  • 11
  • 7
99
votes
11 answers

How to avoid isset() and empty()

I have several older applications that throw a lot of "xyz is undefined" and "undefined offset" messages when running on the E_NOTICE error level, because the existence of variables is not explicitly checked using isset() and consorts. I am…
Pekka
  • 418,526
  • 129
  • 929
  • 1,058
92
votes
15 answers

Why is exception handling bad?

Google's Go language has no exceptions as a design choice, and Linus of Linux fame has called exceptions crap. Why?
joemoe
  • 5,464
  • 8
  • 40
  • 57
73
votes
15 answers

Error logging in C#

I am making my switch from coding in C++ to C#. I need to replace my C++ error logging/reporting macro system with something similar in C#. In my C++ source I can write LOGERR("Some error"); or LOGERR("Error with inputs %s and %d", stringvar,…
Rodney Schuler
  • 2,118
  • 4
  • 23
  • 34
55
votes
17 answers

PHP not displaying errors even though display_errors = On

I have a Ubuntu server running Apache2 with PHP 5. In the php.ini I set display_errors = On and error_reporting = E_ALL | E_STRICT, but PHP is still not displaying error messages. I'm also using Apache virtual hosts. Also, what is the most strict…
wowpatrick
  • 4,832
  • 12
  • 52
  • 81
39
votes
2 answers

Application_Error in global.asax not catching errors in WebAPI

For a project I am working on, one of the things we're implementing is something that we have code for in some of my teams older ASP.NET and MVC projects - an Application_Error exception catcher that dispatches an email to the development team with…
Andrew Gray
  • 3,563
  • 3
  • 30
  • 64
32
votes
10 answers

How to display errors on laravel 4?

I'm trying to create an app on Laravel 4 beta but I can't debug it because it doesn't show any error, display_errors is on, error_reporting is E_ALL and debug => true (config/app.php). When I try to do an error on public/index.php it shows a parse…
Blue Genie
  • 1,847
  • 1
  • 13
  • 19
29
votes
8 answers

What is the recommended error_reporting() setting for development? What about E_STRICT?

Typically I use E_ALL to see anything that PHP might say about my code to try and improve it. I just noticed a error constant E_STRICT, but have never used or heard about it, is this a good setting to use for development? The manual says: Run-time…
SeanDowney
  • 16,172
  • 17
  • 77
  • 88
29
votes
8 answers

WinQual: Why would WER not accept code-signing certificates?

Edit as of 1/24/2015: It is not possible to use other trusted certificate authorities now. Question and answer is not obsolete: WinQual still rejects the signature: when we've already established that it is a valid digital signature: For…
Ian Boyd
  • 220,884
  • 228
  • 805
  • 1,125
28
votes
6 answers

How can I stop PHP notices from appearing in wordpress?

I know about error_reporting(0);, and ini_set('display_errors', false);, but there is a notice appearing in wordpress: Notice: Array to string conversion in /var/www/vhosts/treethink.net/subdomains/parkridge/httpdocs/wp-includes/formatting.php on…
Carson Myers
  • 34,352
  • 35
  • 118
  • 164
27
votes
2 answers

How can I display (echo/print) the currently set error reporting level in PHP?

I am working on a rather large project (multiple teams) so I don't have complete control over the code. Unfortunately, error_reporting is changed in many places throughout the code. When I get to a certain point in the code, I want to see what…
Trevor
  • 273
  • 1
  • 3
  • 4
1
2 3
28 29