Setting PHP Error Message using .htaccess
If you've done PHP programming must be familiar with the error message (error message) is: Parse Error. Right? Error message is of course greatly help us to do the trace / tracing the location of errors in PHP code that we created. However, the error that occurred sometimes quite annoying when accessed by visitors and sometimes could be a hint for hackers who intend poorly on our web site. The following are interesting tips for setting up an error message or even eliminate completely the error message that appears. Ready? Let's go!
The reverse is also very troublesome. When we hire a hosting on a server that by default eliminates the error message, then we will have difficulty when performing debugging of errors that occur in our code. It must be hard to find without guidance error at all, while in the execution of a blank screen appears in the browser.
Setting this error message can be done in our PHP file by using the error_reporting function. But that's not what I will discuss here. I will discuss here is how to bring up or turn off the error message to use .htaccess file.
. htaccess file is a hidden file that we can put in any directory that we created.
This file is used to perform local settings to the directory where the file is located and the directory beneath it.
Well, the way is very easy. If the file does not exist yet, simply make a file named .htaccess and edit (do not forget to add a dot in front of the filename is yes).
Once opened to edit, just add the following line:
php_flag display_errors on
This line is to bring PHP error, while for the deadly error of course you've guessed it?
php_flag display_errors off
Wrong, that way you can set up an error message that appears. Of course the actual PHP has several levels to display an error ranging from none to the most complete and no way to choose the level of error which we will come up, but we discussed it later, yes.
Besides using .htaccess file, we can also do PHP error settings for each file / PHP script that we created.
Incoming search terms:
- error code on website setting php

Twitter
Youtube
Digg
Delicious
StumbleUpon
Facebook