2

I want to disable all php-warnings, errors, notices, etc. so ajax-requests don´t fail when there is an error in a script (in dev-mode).

In php.ini I´ve set display_errors = Off, and in phpinfo() display_errors shows as off (both local & global). But in my scripts I still get error-warnings. I already checked .htaccess but can´t figure out why error´s still get shown. Any help or hint?

I´m running PHP 5.6.1 using MAMP on a Mac 10.10 if that helps.

P.S: I don´t want to turn off error_reporting because I still want to get the errors in my log

2
  • Are you sure that the only reason that causes your AJAX request to be failed? Commented Feb 11, 2015 at 11:53
  • You need stop programming poor code's and begin write good codes. this errors will be disapear Commented Feb 11, 2015 at 11:55

1 Answer 1

3

There could be a call to change that setting in one of the scripts you run. Most likley the case. Also check if a htaccess file alters any settings which could also be the case.

Sign up to request clarification or add additional context in comments.

5 Comments

I thought so as well and tried to find that setting. I searched for ini_set(*) in every file but did´t find anything. Or is there another function that changes this behavior? The weird thing is that phpinfo() shows the correct setting just does the wrong thing.
Try to search for error_reporting function calls to. Error reporting settings can be a bit of a jungle at times since they can be set and altered in the ini file, source code, htaccess files etc.
What is the script or the application that you are using? @VincensvonBibra
Thanks! I found out on of the scripts I am using has an own error-handler, which printed error_get_last(); So I commented this out and now it works. Thanks mate!
Great, glad you found it. Can be a bit of a hassle in large systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.