Tags
Asked 2 years ago
9 Jun 2021
Views 214
Cimb

Cimb posted

Turn off display errors using file php.ini

Turn off display errors using file "php.ini"
lain

lain
answered Apr 25 '23 00:00

To turn off display errors using the php.ini file, follow these steps:

1.Locate the php.ini file on your server. You can find the location by running the phpinfo() function in a PHP script and looking for the "Loaded Configuration File" value.

2.Open the php.ini file using a text editor.

3.Search for the "display_errors" setting in the file. By default, it is set to "On".

4.Change the value to "Off" to disable displaying errors in the browser:




display_errors = Off

5Save the changes to the php.ini file.


6Restart your web server to apply the changes.

After following these steps, PHP errors will no longer be displayed in the browser. Instead, they will be logged to a file, which you can view using an error reporting tool or by checking the server's error log
Post Answer