Page 1 of 1

not seeing all the errors in Apache

Posted: Sun Apr 04, 2004 6:27 am
by davidklonski
Hello

I am using Apache Web server to test my PHP scripts.
For some reasons I don't see some error messages when I run scripts while my friend who has Xitami Web server does sees them.

How do I configure Apache to show me all the errors, warnings and so on (very important in developement time)?

thanks

Posted: Sun Apr 04, 2004 7:52 am
by Pozor
Hello,

use

Code: Select all

<?php
error_reporting(E_ALL); 
?>
greez Pozor

Posted: Mon Apr 05, 2004 3:55 am
by twigletmac
Edit your php.ini file to ensure that you have:

Code: Select all

display_errors = on
and

Code: Select all

error_reporting = E_ALL
Mac

Missing warning messages

Posted: Mon Apr 05, 2004 7:11 am
by davidklonski
Here is a sample code that I am testing:

Code: Select all

<?php 
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'on');
?>

<html>
<?php setcookie("test", "value", time() + 1000); ?>
<body>
cookie sent Text
</body>
</html>
[/

Code: Select all

As you notice, there is a single space before the <html> tag and that should cause a warning (I am sending a cookie information AFTER the headers are already sent).
When I run this code in Zend Studio, I see the warning.  However, when I run it directly in IE, I don't see any warning or error!

What am I doing wrong?  It could be a problem in the php.ini configuration file?  I am setting error-handling-values in my script.

Once I make those changes in php.ini, do I need to restart Apache and the changes will automatically take affect?

thanks

Posted: Mon Apr 05, 2004 7:27 am
by twigletmac
If you make the change in the php.ini restarting Apache should have it take effect. If you want to set the config variable in your code, maybe try:

Code: Select all

ini_set('display_errors', 1);
Mac