?
Solved

lower the error reporting level in php.ini

Posted on 2006-10-24
8
Medium Priority
?
337 Views
Last Modified: 2011-09-20
hello,
how can I lower the error reporting level in php.ini?
0
Comment
Question by:Sabrin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 143

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 143

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 
LVL 143

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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

719 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