Superior Web Solutions 905 532 9642
HOME CLIENTS SERVICES BLOG ABOUT US CONTACT US
Categories:
 Internet Marketing
 iPhone iPad Apps Development
 IT Humour
 IT Industry News
 Search Engines
 User Guides
 Web Development
Browse by tags
Search Blog:
RSS
Subscribe to our newsletter
Name*:
E-Mail*:
Recent Posts
Most Common Screen Resolutions in 2011
Make PHP CAPTCHA more secure
Updated Stats
What Googles New Search Security Measures Mean to You
GoDaddy Mod_Rewrite Problem
What is the default font size in Browsers?
January 07, 2010 - The Importance of Error Reporting in Website Development

Displaying errors, warning, or notices is important in all stages of website development. During initial development, it provides line numbers where errors occur and developers spot and fix all errors faster. During testing, it shows warnings and notices when running test scenarios, and tracks all bugs. During production it writes errors to a log file, and sends an email to the website administrator for immediate attention.
 
When programming in PHP, a popular website programming language, error reporting functions display or write all errors, warnings or notices that PHP code produces into a log file. This is very useful and important to overall website performance. A company came to us and said they had a website with poor performance; page loading times were too slow. We copied their code to our server with error reporting turned on and saw 60 warnings during home page loading. This was hidden on their server which had no error reporting. We went to the code and fixed the problems. This had a dramatic effect on website loading times; they went from 6.12 seconds to 0.25 seconds immediately for all pages.   
 
The sample of errors below clearly explains the problem and where the website developer should look in the code.
 
Sample of error, warning and notice
 
Parse error: syntax error, unexpected T_VARIABLE in /var/www/vhosts/domain.com/httpdocs/index.php on line 11
Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/domain.com/httpdocs/index.php on line 56
Notice: Undefined variable: var in /var/www/vhosts/domain.com/httpdocs/index.php on line 21
 
Below are the easy instructions used to enable error reporting in PHP.
 
How to turn on Error Reporting in PHP
 
-          In PHP code
ini_set('display_errors',1);
error_reporting
(E_ALL|E_STRICT);
This will display all error, warnings ant notices.
 
-          In php.ini
error_reporting = E_ALL
 
-          In .htaccess
php_flag display_errors on
php_value error_reporting 7

 

Associated tags:  PHP, Error Reporting, Error_reporting, Php.ini
Add Comment:
Name*:
E-Mail: Website:
Your message*:
»
© 2000 - 2012 Superior Web Solutions Web design    Web development    Online marketing