Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Php How to show all errors in PHP?

 
 

Share on Google+Share on Google+

How to show all errors in PHP?

Advertisement
Learn how to show all errors in PHP while developing web applications?

How to show all errors in PHP?

I this tutorial I will explain you how you can make changes in your code for displaying all the warning and error messages in your PHP program. This is one of the most asked question "How to show all errors in PHP?" by the PHP developers. As it is necessary to see all the errors while developing PHP programs.

What change I should make in the code for displaying all the errors and warning message while developing PHP based applications?

It is very easy to instruct the PHP to display all the errors and warning messages. You can have to add the three lines of code in your PHP program. You can create a include file and then include the file using following code:

<?php
include_once "mycommonsettings.php";
?>

You can include the following code in mycommonsettings.php file:

<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
?> 

Above code instructs the PHP to report all the errors and warning messages.

You can remove the error reporting code before moving your code on the production environment.

This is one of the best way to report errors in PHP programs while developing the PHP web applications. This will save a lot of time in finding and fixing the bugs.

Check PHP tutorials section for huge collection of PHP and MySQL examples.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 22, 2013

Related Tutorials

Discuss: How to show all errors in PHP?  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com