tags:

views:

84

answers:

3

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!!

+2  A: 

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

error_reporting(E_ALL);
ini_set('display_errors', 1);
unset
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
@Pekka: That is very personal and alien language :)
Sarfraz
@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
@Pekka: That is good to know, interestingly i have been inviting my friends but yet I have not found one.
Sarfraz
Obviously I can earn much more reputation by answering php related questions than by helping some cocoa heads ;-)Hi Pekka ;)
unset
@unset hi! :) Yeah, the PHP tag is definitely more popular than the iPhone one. But the real prize, if you're after reputation, is in C#, java and .net (see the "tags" page)... Anyway. I'm sure you'll like it here.
Pekka
Oh yeah, I like it here. The last few weeks I learned so much from this site … I felt like give something back. And the concept is as simple as exciting :D
unset
It definitely is. To reach me in a comment directly, you need to address me using @Pekka btw so it pops up (Vote here if you want that changed: http://meta.stackoverflow.com/questions/45360/subscribing-to-questions-and-comments-that-dont-belong-to-you) :)
Pekka
A: 

This should show you all messages:

ini_set('display_errors', true);
error_reporting(E_ALL);
Sarfraz
+1  A: 

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.

salathe
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
John Isaacks