error reporting via php.ini fails

Problems with the Windows version of XAMPP, questions, comments, and anything related.

error reporting via php.ini fails

Postby Teddy-O » 18. February 2007 23:51

In my php.ini file I have the error_reporting property set to E_ALL and the display_errors property set to On, but when I use an unassigned variable I do not get an error message back in my web page.

For example:

<html>
<body>
<?php
echo $foo;
?>
</body>
</html>

should return a page with a message like:

Notice: Undefined variable: foo in C:\Program Files\xampp\htdocs\\foo.php on line 4

Instead I get a blank page. I restarted Apache after changing the PHP.ini file. If I use the command line or if I use an error_reporting(E_ALL) directive at the top of my PHP code I get the appropriate error message.

Has anyone seen this behavior?
Teddy-O
 
Posts: 3
Joined: 18. February 2007 23:29
Location: USA

Postby Wiedmann » 18. February 2007 23:52

You have used the wrong "php.ini".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Teddy-O » 19. February 2007 00:07

I am using the php.ini file at the root of XAMPP/PHP, NOT php.ini-recommended or php.ini-dist. Is there another php.ini file somewhere?

Also, the command line method of running the php file works correctly, and I believe it uses the php.ini file at the root of XAMPP.
Last edited by Teddy-O on 19. February 2007 00:10, edited 1 time in total.
Teddy-O
 
Posts: 3
Joined: 18. February 2007 23:29
Location: USA

Postby Wiedmann » 19. February 2007 00:10

Is there another php.ini file somewhere?

Well, you can read the XAMPP/Win homepage, the XAMPP demopages,

or just look at phpinfo() which "php.ini" is used.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Teddy-O » 19. February 2007 00:23

Phpinfo() revealed that Apache is using the php.ini file at ...\xampp\apache\bin\php.ini, not the one I changed at ...\xampp\php\php.ini. The one inside the Apache bin folder has the error_reporting property set to E_ALL & ~E_NOTICE, which, of course, prevents the unassigned variable "notice".

I also see the very clear explanation in the XAMPP for Windows FAQ.

Alles klar! Danke shoen.
Teddy-O
 
Posts: 3
Joined: 18. February 2007 23:29
Location: USA


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 120 guests