Re: A simple (dumb) Rookie question
- From: Michael Fesser <netizen@xxxxxx>
- Date: Fri, 20 Mar 2009 13:02:14 +0100
..oO(j.keßler)
Michael Fesser wrote:
Fix your error reporting. On a development machine it must be set to
E_ALL|E_STRICT in the php.ini. Also make sure that display_errors is on.
Then you would have seen immediately what's wrong.
Of course on the production server errors should not be shown, but
written to a logfile instead.
Micha
eg. (it could be that you are not allowed to use ini_set)
Correct, but on your own dev machine using the php.ini is usually better
for a simple reason: if display_errors() should be off in the php.ini,
then using ini_set() won't help much in case of parse errors.
<?php
if(DEBUG === true) {
ini_set('error_reporting',8191); // E_ALL & E_STRICT
ini_set('display_errors',true);
}
else {
ini_set('error_reporting',8191); // E_ALL & E_STRICT
ini_set('display_errors',false);
ini_set('log_errors',true);
ini_set('log_errors_max_len',"10M");
ini_set('error_log','/error/error.file');
}
?>
The second part is what I usually do, on my local server as well as on
the production server. I always write to a logfile (on my Linux box it's
just a named pipe with a simple listening script on the other end, which
immediately prints out all the data it receives), but with different log
levels: LOG_INFO or even LOG_DEBUG on my local box, LOG_WARNING on the
production server.
Micha
.
- References:
- A simple (dumb) Rookie question
- From: Kenneth McVay OBC
- Re: A simple (dumb) Rookie question
- From: Jerry Stuckle
- Re: A simple (dumb) Rookie question
- From: Kenneth McVay OBC
- Re: A simple (dumb) Rookie question
- From: Curtis Dyer
- Re: A simple (dumb) Rookie question
- From: Kenneth McVay OBC
- Re: A simple (dumb) Rookie question
- From: Michael Fesser
- Re: A simple (dumb) Rookie question
- From: "j.keßler"
- A simple (dumb) Rookie question
- Prev by Date: Re: A simple (dumb) Rookie question
- Next by Date: Re: I want export data to XL Sheet
- Previous by thread: Re: A simple (dumb) Rookie question
- Next by thread: Re: A simple (dumb) Rookie question
- Index(es):
Relevant Pages
|