1

I am migrating from PHP4 to PHP5

I have this in my .htaccess:

php_flag display_errors on
php_value error_reporting 2039

Which used to show all errors.

I am still getting some errors but I used to get an error when I called a function that was not defined, but now it stops where it is at and send the client everything up to the error and nothing after. With no error message.

Here is what phpinfo is telling me:

Directive   Local Value Master Value
display_errors  On  Off
error_reporting 2039    6143

I would like to be able to see my error messages for trouble shooting purposes.

Can someone tell me what I need to do? Thanks!!

3
  • Can you show the full PHP script? It could be that it terminates with a parse error, which indeed isn't caught by the error handler. Commented May 17, 2010 at 18:24
  • error_reporting(E_ALL) in your php ? Commented May 17, 2010 at 18:25
  • OK so as it turns out I was including a page that had error_reporting(!E_NOTICE); at the top of it, (but my current page did not say this, just the included page). I can understand now why this would prevent my error from showing but what I find very curious is why this only started being an issue now that I moved to php5 and never caused problems when I was on php4 Commented May 17, 2010 at 18:47

3 Answers 3

6

If everything fails, just put this code at the beginning of your (/of each) script:

error_reporting(E_ALL);
ini_set('display_errors', 1);
Sign up to request clarification or add additional context in comments.

8 Comments

I think I know this man! :D Willkommen, alter. Ich hab im Postausgang noch eine Mail an dich mit dem Tipp, mal hier reinzuschauen...
@Pekka: That is very personal and alien language :)
@Sarfraz just this once :) He is a colleague and mate of mine who I've been meaning to invite here for a long time (but ended up here independently from me now).
@Pekka: That is good to know, interestingly i have been inviting my friends but yet I have not found one.
Obviously I can earn much more reputation by answering php related questions than by helping some cocoa heads ;-) Hi Pekka ;)
|
1

This should show you all messages:

ini_set('display_errors', true);
error_reporting(E_ALL);

Comments

1

I'd guess that you PHP 5 version is >= PHP 5.2.0 and that the original error reporting level was E_ALL & ~E_NOTICE (or E_ALL ^ E_NOTICE, both have the same result).

Prior to PHP 5.2.0 E_ALL had a value of 2047, so your error level was 2039 due to not including the E_NOTICE level (of 8). As of PHP 5.2.0 E_ALL changed to 6143 (and as of PHP 5.3.0 to 30719) which means E_ALL & ~E_NOTICE is no longer 2039, but rather 6135 (or 30711 in PHP 5.3).

As for not displaying the errors (calling an undefined function should be a fatal error!), see the other answers.

1 Comment

So basically it looks like I will always need my error level to be Max-8. I wonder if there is a way to express this in .htaccess

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.