eveo
eveo

Reputation: 2843

Turn php error reporting off in xampp?

I just installed xampp, getting errors all over the place. Want to get rid of error handling. It's only annoying errors to do with my variables.

I'm not sure where to find php.ini, it doesn't exist in my C:\xampp\apache

Upvotes: 9

Views: 73941

Answers (5)

72lions
72lions

Reputation: 710

Inside your php.ini make sure that you have display_errors to Off. From what I understand if you set display_errors to Off then the error_reporting directive doesn't need to change.

Example:

error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off

Upvotes: 20

Claudio
Claudio

Reputation: 296

Xampp and other web applications have an error interface to show programmers (and users) execution errors or warnings (notices). In order to modify the way Xampp shows errors you have to go control panel and open php.ini. Inside this file you can find two points to modify the way it shows errors:

  1. “display_errors = On”. From my point of view it has to be On all the time. If you put Off you won’t have any info regarding bad sentences.

  2. “error_reporting=E_ALL”. This is the key point. Changing the value of it you can change the way it shows errors. Inside php.ini is documented all options. My favorites:

    • error_reporting=E_ALL  it shows everything. Good for debug.
    • error_reporting=E_ALL & ~E_STRICT & ~E_DEPRECATED  it shows errors & notice (very important for debugging) and not shows suggestions & deprecated functions in next php versions.
    • error_reporting=E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED  production environment not including Notices.

I hope this fit for you.

More details https://community.apachefriends.org/f/viewtopic.php?f=17&t=50989

Upvotes: 1

Mark
Mark

Reputation: 229

This is very old now, but in case someone comes across this there's a XAMMP issue with version 5.6.3. I had the same issue with error display set to 'off' and it was still showing up as on in phpinfo()

For some reason, they added the error reporting in php.ini twice. display_errors shows on line 99 of php.ini, and then again on line 552.

So if you scroll down and disable the first one, the second one is still set to 'on' and overrides the first one leaving error reporting active.

I'm sure this will be fixed with future versions of XAMMP, but wanted to add this here for anyone that comes here looking for an answer to this problem.

Upvotes: 3

Randika
Randika

Reputation: 127

in php.ini, do the following change,

display_errors = Off

Upvotes: 2

Anuj Dubey
Anuj Dubey

Reputation: 41

If you set display_errors=off then all types of error will of.

But if you only want to notice error off the you can set error_reporting = E_ALL & ~E_NOTICE

Upvotes: 1

Related Questions