DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Let Php Show All Errors

03.20.2006
| 698811 views |
  • submit to reddit
        I have wondered why my php script doesn't show
errors like it did before. It seems my server admin
has default config set not to show the errors.

Here's how to override it.
error_reporting(E_ALL);
ini_set('display_errors', '1');

BTW, it's really a pain to code in a language that
demand a ';' after every line.    

Comments

Jhon Smith replied on Fri, 2014/04/18 - 1:50am

You provide a good post to solve these errors by using this method. This is good trick to solve PHP error repoting. 

computertechsupport247  

Budy K. Ir replied on Tue, 2014/03/18 - 11:30pm

pain with ';'   ? try Python :D  Python 

Jaffa Wify replied on Tue, 2013/10/22 - 2:39am

 Distinct compilers permit been developed which decouple the PHP tongue from the interpreter. Benefits of compilation contain mend guillotine run, unchanging analysis, besides improved interoperability among canon written in different phraseologys. Thank you.  press release distribution services

Joseph P Joseph replied on Tue, 2013/09/10 - 3:26am

This is a very good PHP error reporting tool. Registering the errors and not displaying them as they occur is a very convenient means of completing the work in time. It also helps in tracking the errors that has occurred. Try this link to get more information on PHP error reporting. 

fix now 


Maria Bales replied on Fri, 2012/08/10 - 4:00am

There is a great guide to implementing this plus how to make the system log the errors instead of displaying them and code specific for drupal, wordpress and other cms systems

 

Snippets Manager replied on Mon, 2011/08/01 - 5:05am

Here's the best reference for setting PHP's error reporting: http://www.bx.com.au/tools/ultimate-php-error-reporting-wizard

Snippets Manager replied on Tue, 2009/09/22 - 3:21am

Snippets Manager replied on Tue, 2009/09/22 - 3:21am

This is a great method. There is a great guide to implementing this plus how to make the system log the errors instead of displaying them and code specific for drupal, wordpress and other cms systems. check it out http://itslennysfault.com/force-php-to-show-all-errors-or-save-them-to-a-log-for-trouble-shooting

Hans Zimmer replied on Tue, 2006/03/28 - 11:16am

Coming from the C and Perl side I don't mind the trailing semicolon. Although I like Ruby very much these day. ;)

Snippets Manager replied on Mon, 2012/05/07 - 2:21pm

korakot is primarily a Python coder, not ASP ;-) That said, Ruby is similar.

Chris Meller replied on Mon, 2006/02/20 - 4:02am

If you don't like the ; maybe you'd be happier back in ASP, where you have no idea when a line's ending... Unfortunately, then you'd have to deal with the other million ASP suckage points.