|
Php Error Reporting |
This is a tutorial for Error Reporting. Why Error Reporting is important for development? When we have to off error reporting ? The answer is when we are not developing or when we are releasing codes to the web-server for public use.
For Example (Screenshot 1) Codes :-
|
Screenshot1 |
output (Screenshot 2) :-
|
Error Reporting |
Output of this code will be blank because we does not put semi colon “;” at defining the string, it will also not show us error at that time error reporting is useful to us. Same example you can see in screenshot 3
|
Screenshot3 |
and output is nothing as shown in screenshot 4.
|
Screenshot4 |
We are Missing semi colon “;” , now my error reporting is off in php.ini file or in php configuration files so, I should have to turn on.
Now If you open your C:\xampp\php folder, we need php.ini file (Screenshot 5).
|
C:\xampp\php folder, we need php.ini file (Screenshot 5). |
In (Screenshot 6)
|
Screenshot6 |
you will see php.ini file in which you will see a warning, About php.in, etc. Now in notepad Edit > Find, and find error_reporting (Screenshot 7).
|
Screenshot7 |
When you will click on Button Find next, notepad will Error Handling and Logging (Screenshot 8).
|
Screenshot8 |
In this way, you will see all states or all setting of error reporting like E_All, E_ERROR, E_WARNING, E_PARSE, E_NOTICE, E_STRICT, E_Core_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, E_USER_ERROR, E_USER, WARNING, E_USER_NOTICE , etc with all the description. By Default, error_reporting value is zero. Now this is error Reporting off as we seen in our Browser (Screenshot 9).
|
Screenshot9 |
Now Lets change this value to E_All in this Tutorial (Screenshot 10).
|
Screenshot10 |
Always Remember when ever you change php setting or php configuration file you should refresh Xampp server by control panel apache and MySQL stop and start button. E_All is for all errors and warnings (Don’t include E_Strict). Now you will see (Screenshot 11).
|
Screenshot11 |
It shows Error of “;” which we forget in (Screenshot 1). This was short description on Error Reporting Now read more on More on Error Reporting
No comments:
Post a Comment
Thanks For Comment Will get you Soon..