Re: A simple (dumb) Rookie question



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



Relevant Pages

  • Could not load file or assembly System.Web.Extensions
    ... I've downloaded the AJAX Extension and the CTP ... December package and installed on BOTH my development machine and the ... production server: On the development machine everything is on drive ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: A question on debugging
    ... But it clearly has nothing to do with the custom errors tag as I am catching all exceptions from the Application_OnError event and emailing them to myself. ... On my development machine I get the line number in the stack trace, but not on the production server. ...
    (microsoft.public.dotnet.general)
  • Re: [PHP] Friday morning brain farts....
    ... holiday this week. ... on a production server attached to the Internet, ... development machine, E_NOTICE is always enabled. ... reason it's good to enable notices on a production server is because ...
    (php.general)
  • Membership stuff acts wierd on production server
    ... My site is utilizing asp.net membership. ... development machine. ... I copied the entire directory to the production server. ... On my local dev machine it spits out all the roles ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [PHP] Friday morning brain farts....
    ... I vote that it should be later in the year. ... on a production server attached to the Internet, ... development machine, E_NOTICE is always enabled. ... I get an email from each server containing the contents of the error log from the previous day and my first task each day is to go through that and track down any issues that usage has highlighted. ...
    (php.general)