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
not seeing all the errors in Apache
Moderator: General Moderators
-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Edit your php.ini file to ensure that you have:
and
Mac
Code: Select all
display_errors = onCode: Select all
error_reporting = E_ALL-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
Missing warning messages
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- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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:
Mac
Code: Select all
ini_set('display_errors', 1);