How to Show All errors in PHP?

errors

About this article: Posted in: Learned along the way
By: Blockcoder ( Admin ) / 13.11.2012
Stats: no comments / Views: 1,026
Tags: , ,

http://ians.ru/detskaya-odezhda-praktichnye-resheniya-na-zimu-i-na-leto.html

I want to see some PHP ERRORS!

There are times when you want to see more deeply in php.
I assume You are programming with php to get something working in your website. When something goes wrong while developing, your site just shows white page or just won’t work. These are the times when you really don’t know what’s going wrong with your website. If you could see even the errors-reports, you might figure out what you are doing wrong.

So, I will show you the right path.


The Rightious path

Usually the server admin has default config set not to show the php errors. This next block of code will override it.

One (right) way to let the php show error reportings is this:

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

I suggest you to write that between the head -tags or somewhere at the beginning of your site. When you start developing again and there happens to be some errors in your code, it will now show them to you. It will help, I promise. Thank you.


Leave a Reply

Your email address will not be published. Required fields are marked *

23,651 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>