-2

I just wonder how I can activate errormessages in .php. When I do php at home I always get messages like "No closing bracket on line 232" and stuff like that, but when I do .php at work there's no such feature. Guess it has something to do with the domain/server, so does anyone know how to activate this so I can easier find the errors?

Tom
  • 1,747
  • 5
  • 23
  • 39
  • 4
    Maybe this can help: [PHP 5.3 does not display error messages](http://stackoverflow.com/questions/5680831/php-5-3-does-not-display-error-messages) – Florent Jul 12 '12 at 09:39
  • `error_reporting(E_ALL); ini_set('display_errors', 1);` http://php.net/manual/en/errorfunc.configuration.php – DaveRandom Jul 12 '12 at 09:40
  • 2
    It's probably important to add, when to enable error reporting and when to turn it off. If you're developing in your **development-environment** then it's a good idea to set `error_reporting` in such a way that every error/warning/notice is shown. In the **production-environment** it's a bad idea to do that because the error-messages shown may expose sensitive information. Always keep those separated. – vstm Jul 12 '12 at 09:46

2 Answers2

2

Sounds like display_errors and or a bunch of the other PHP error reporting is turned off in the php.ini file you use at work.

Also, if you use something like Eclipse PDT, it will give you a lovely working environment.

Fluffeh
  • 33,228
  • 16
  • 67
  • 80
1

There are basically 2 settings you can manipulate on code level:

error_reporting(E_ALL);

and

ini_set('display_errors', 'On');

That should do the trick.

Sherlock
  • 7,525
  • 6
  • 38
  • 79