Solved

lower the error reporting level in php.ini

Posted on 2006-10-24
8
327 Views
Last Modified: 2011-09-20
hello,
how can I lower the error reporting level in php.ini?
0
Comment
Question by:Sabrin
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17801179
full technical article:
http://php.net/error_reporting
0
 

Author Comment

by:Sabrin
ID: 17801184
I dont want to get technical thats why im asking here!
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17801199
but changing the setting in the php.ini IS technical.
the doc tells you want value to set to get a certain behaviour.
the doc also tells you that you can change the behaviour at run time using error_reporting() function.

there are also other settings that can influence error display:
http://php.net/manual/de/ref.errorfunc.php#errorfunc.constants

setting the error level to 0 will show no errors at all
0
 

Author Comment

by:Sabrin
ID: 17801205
what If I have this (error_reporting  =  E_ALL) in php.ini
and this (LogLevel   crit) in httpd.conf

will I see any errors in the browser ?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17801325
you will see all php errors, but only critical apache errors
0
 
LVL 48

Expert Comment

by:hernst42
ID: 17801581
If you see errors in the rowser depends on the php.ini setting display_errors. If its on all errors that match error_reporting are printed to screen. If display_errors is off no error (even fatal errors) will be displayed
0
 
LVL 16

Accepted Solution

by:
ellandrd earned 500 total points
ID: 17810701
You don't need to change the error reporting in php.ini, you can do it on a script by script basis, which is neat for debugging only certain areas of code. for example:

<?php
// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

?>
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 17856240
thank you
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now