Disable Error Reporting Php.ini
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Turn Off Display Error PHP.ini up vote 20 down vote favorite 9 I am trying to turn off all errors on my website. I have followed different tutorials on how to do this but I keep getting read and open error messages. Is there something I am missing? I have tried the following in my php.ini file: ;Error display display_startup_errors = Off display_errors = Off html_errors = Off docref_root = 0 docref_ext = 0 For some reason when I do a fileopen() call for a file which does not exist, I still get the error displayed. This is not safe for a live website, for obvious reasons. Thanks php share|improve this question edited May 23 '14 at 10:15 FruitBreak 515617 asked Apr 11 '13 at 12:52 Jms Bnd 3552615 1 Try to explicitly set it via ini_set() function in your script. However it's a bad practice and you should catch the errors and do something with them instead of hiding via display_Errors –Royal Bg Apr 11 '13 at 12:54 I suggest running grep display_errors /path/to/php.ini to see if your line is getting overrided somewhere down the file. This is what was happening to me. –usandfriends Aug 21 '15 at 18:02 add a comment| 10 Answers 10 active oldest votes up vote 22 down vote accepted I always use something like this in a configuration file: // toggle this to change the setting define('DEBUG', true); // you want all errors to be triggered error_reporting(E_ALL); if(DEBUG == true) { // you're developing, so you want all errors to be shown display_errors(true); // logging is usually overkill during dev log_errors(false); } else { // you don't want to display errors on a prod environment display_errors(false); // you definitely wanna log any occurring log_errors(true); } This allows easy toggling between debug settings. You can improve this further by checking on which server the code is running (dev, test, acceptance, prod) and change your settings accordingly. Note that no errors will be logged if error_reporting is set to 0, as cleverly remarked by Korri. share|improve this
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How do I disable ALL error messages via php.ini? up vote 2 down vote favorite 1 Despite the following settings below, I often http://stackoverflow.com/questions/15949304/turn-off-display-error-php-ini see the path to the file producing the error. How do I turn off ALL errors no matter what? error_reporting = E_ALL display_errors = off log_errors = off php logging php.ini share|improve this question edited Jan 2 '13 at 22:17 cpast 1,97411023 asked Jan 2 '13 at 22:15 PeanutsMonkey 3,1451766104 What command is giving the error, and what error is it showing? –Bort Jan 2 '13 at 22:45 @Bort - I would like it not to show file paths http://superuser.com/questions/527296/how-do-i-disable-all-error-messages-via-php-ini assuming there is a coding error, etc –PeanutsMonkey Jan 2 '13 at 23:24 add a comment| 1 Answer 1 active oldest votes up vote 7 down vote accepted The display error statement is not what you actually want. You should change also the error_reporting value if you don't want to have the messages informing you about the error. You should try this for all errors error_reporting = off or error_reporting = E_ALL & ~E_DEPRECATED this will keep letting you know about the errors but they will be invisible to other users.. share|improve this answer edited Jan 3 '13 at 2:08 answered Jan 2 '13 at 23:18 Jack 1065 Thanks but how do I change it within the php.ini file as opposed to a php file? –PeanutsMonkey Jan 2 '13 at 23:23 Just be sure to continue logging the errors, otherwise you will wish you did when something bad happens. –Bort Jan 3 '13 at 0:19 @PeanutsMonkey can't you edit the php.ini file with an editor??i guessed the server was at your machine. –Jack Jan 3 '13 at 0:20 @Jack - Yes it is. I thought that error_reporting(0); is limited to PHP files not the php.ini file. –PeanutsMonkey Jan 3 '13 at 1:43 @Jack - I put the line of code i.e. error_reporting(0); and it literally killed the web server. Why is that? I had to remove it before I could bring it back up again. –PeanutsM
To ZooTemplate Sign Up Sign In Search News & Updates / Dec 10, 2009 How to disable notice and warning in PHP.ini file Several times, We have received some questions about the warnings or Notices from our members when they are using our extensions: Hi http://www.zootemplate.com/news-updates/how-to-disable-notice-and-warning-in-phpini-file admin, When i install JV Content Fusion module,it gives me this error: Notice: Undefined variable: secidcount in C:wampwwwjnuOfflinemodulesmod_jv_contenfusion helper.php on line 112 Help. Thanks. Sometime if you are working on some php code and fed up of Warnings or Notices in the browser then easy way out is to disable the settings in PHP.ini file. This is a configuration file which is loaded each time you start your PHP+Apache. It was doing everything it disable error was supposed to but at the same time it was throwing errors and warning which doesn’t make sense and were harmful for the application. Here is the method to change the settings in PHP.ini file: Open PH.ini file. In this file search for the phrase “ error_reporting = E_ALL” ,[without inverted commas] Here replace this with “error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING “ (Show all errors, except for notices and coding standards warnings) disable error reporting Make sure you change the real enabled part of this , there are certain other examples given in the file. Restart your PHP + Apache Now, no warnings and messages will appear in the browser. Share Tweet Share Share Share Related Articles How to install Joomla 1.5 Zootemplate supports Easy Blog!- An awesome blogging tool from Stackideas What is the priority? Speed of Site or Responsive Design ammy thanks too much cliffsupport This should be a good combination. error_reporting = E_ALL & ~E_NOTICE Manikandan How to disable notice and warning error without using in PHP.ini file Like(error_reporting = E_ALL & ~E_NOTICE) Please let me know if you know any other alternate solutions. Thanks Mani anonym thx Peter Mutisya Rather use error_reporting(0); Ian Leaf Fraud We can use error_reporting(0); only when we have notice, in case of warning we have to resolve that issue. subscribe & follow We provide you the best service and support comes, register to receive service information twitter facebook dribbble Useful LinksOur Partner Our Affiliate Program Affiliate Guidelines FAQs Contact Us LegalCopyright Terms of Use Privacy Policy Money Back Guarantee Validate License Copyright © 2008 - 2016 ZooTemplate - a brand of CleverSoft. All Rights Reserved Email Address * First Name Last Name Error: Please enter a valid email addressError: Invalid emailError: Please enter your first nameError: Please