0

I'm working with PHP and have got the error logging turned on and turned up with:

error_reporting = E_ALL | E_STRICT

log_errors = On
error_log = /path/to/file
display_errors = Off

Now this log files catches most PHP errors but occasionally I will make a change and have the page fail to display with no logging to the file.

A specific example of this is if I do:

 interface InterfaceClass
 {
     public function someFunction();
 }

 class InterfaceInheriter implements InterfaceClass
 { 
     final public function someFunction()
     {

     }   
 }

  class FirstDerived extends InterfaceInheriter
  {   
      public function someFunction()
      {

      }
 }

Now this is all well and good, and i'm sure I have made some error, but where can I get the feedback from the interpreter for this?

ANSWER: Since i'm using Wordpress it turns out that it was somehow filtering out some log messages. I fixed it in the end by setting the appropriate logging configuration for Wordpress.

Thanks for the help!

4
  • I can't reproduce this. Granted, I'm logging to Apache's error_log, but I get [Fri Jul 02 02:49:04 2010] [error] [client 93.108.152.52] PHP Fatal error: Class InterfaceInheriter contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (InterfaceInheriter::someFunction) in /home/sites/main/a.php on line 10 Commented Jul 2, 2010 at 1:53
  • Yep right you are, I didn't design that example particularly well. I have updated the question with one I just tested that fails and should yield no error logs. Commented Jul 2, 2010 at 2:11
  • 1
    I still get an error: [Fri Jul 02 03:51:40 2010] [error] [client 93.108.152.52] PHP Fatal error: Cannot override final method InterfaceInheriter::someFunction() in /home/sites/main/a.php on line 16 Commented Jul 2, 2010 at 2:52
  • that's interesting I definitely get nothing. I'll have another look at my config and do some general debugging. Commented Jul 2, 2010 at 3:26

1 Answer 1

1

try placing error_reporting(E_ALL | E_STRICT); in the file..

Sign up to request clarification or add additional context in comments.

3 Comments

It's already set in php.ini. Why would it need to be set again with a function?
if the file was included and another script higher up the execution chain was setting error_reporting with a function too.. - simple thing to try for an easy catch when debugging..
tried it and the errors get logged correctly. I'm using Wordpress so now I just have to work out what stupidity it is doing to selectively filter my error logs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.