1

My problem is this: I have errors in my PHP code but they're not being displayed. My script is just terminating when the error is encountered. After much poking, I've deduced that the errors are strict mode errors but I'm having trouble fixing them because the error message is not being displayed.

I'm running PHP 5.4.4 on Debian 3.2 using development config settings ( error_reporting = E_ALL ; display_errors = on )

After much reading I noticed this "Most of E_STRICT errors are evaluated at the compile time thus such errors are not reported..." in the PHP documentation for error reporting (http://php.net/manual/en/function.error-reporting.php#refsect1-function.error-reporting-notes)

How can I see the compile time errors?

DevZer0
  • 13,433
  • 7
  • 27
  • 51
  • make sure what you see on the configuration is the same at runtime. There could be some overrides. – DevZer0 Aug 01 '13 at 02:37
  • @DevZer0 I've set error_reporting(E_ALL); in my code to ensure that error reporting is on at runtime. But I'm not sure how to check the state of error reporting at runtime. PS: Syntax errors are being displayed but the strict errors are not. – Eric T Cruiser Aug 01 '13 at 03:01
  • PPS: (I don't think this matters much but) I'm running my script via the command line so I've been tinkering with the /etc/php5/cli/php.ini file to make my changes. Nothing seems to work. – Eric T Cruiser Aug 01 '13 at 03:07
  • You can do `php -i` to get phpinfo() like output thats formatted for cli – DevZer0 Aug 01 '13 at 03:07
  • Thanks for that @DevZer0. This is my error reporting (from php -i) is: display_errors => STDOUT => STDOUT display_startup_errors => On => On error_reporting => 32767 => 32767 which all looks right to me – Eric T Cruiser Aug 01 '13 at 03:20
  • beats me Eric, i will vote up on your question hopefully someone else can figure it out – DevZer0 Aug 01 '13 at 03:22
  • @Eric Did you try setting `error_reporting = E_ALL` in PHP config file? Because according to the docs, such `STRICT` errors are not displayed only if the `error_reporting` is enhanced to include `E_STRICT` at runtime. – Inglis Baderson Aug 01 '13 at 05:19
  • Hi @AgreeOrNot yep errors are 'error_reporting = E_ALL' I've tried everything: 'E_ALL | E_STRICT' and also '32767'. In both config and at run time.b But nothing seems to work. It's driving me crazy. – Eric T Cruiser Aug 05 '13 at 19:25
  • I discovered the source of the problem. I'm using an old debug function which uses error_reporting() I was setting error reporting to 'E_ALL | E_STRICT' at runtime. When I changed it to 'E_ALL' it worked. Thanks for your help. – Eric T Cruiser Aug 06 '13 at 00:18

0 Answers0