[php] Turning error reporting off php

I wanted to turn off the error reporting on a website. Googling for it I found that placing the code mentioned below in the website stops the errors from getting displayed on the screen. I placed it into my website but it did not work. Please help me out. Thanks

<?php

error_reporting(0); // Turn off all error reporting

?>

This question is related to php

The answer is


Tried this yet?

error_reporting(0);
@ini_set('display_errors', 0);

Does this work?

display_errors = Off

Also, what version of php are you using?


Read up on the configuration settings (e.g., display_errors, display_startup_errors, log_errors) and update your php.ini or .htaccess or .user.ini file, whichever is appropriate.

It works.