Mike Rifgin
Mike Rifgin

Reputation: 10746

Handling apache errors - options

Within httpd.conf or vhosts file it’s possible to:

Are there any other alternatives to dealing with apache error? What i'd really like to do is somehow get hold of an apache error when it occurs in php.

(We're looking to build a tool which monitors errors that occur globally on our servers in a web based interface (using php). Currently I'm thinking of logging errors to a log file and then use php to monitor this file for changes and parse it in to something usable with PHP.)

Upvotes: 0

Views: 132

Answers (1)

larsks
larsks

Reputation: 311645

You can use the ErrorDocument directive to redirect errors to your own PHP application that:

  • Displays an error message to the user, and
  • Performs any other work necessary to handle the error.

That is, the target of your ErrorDocument does not need to be simply a static error page; it can be any URL you want and you can take whatever action you would like in response to the request.

This will probably be more effective than scraping the log.

Upvotes: 1

Related Questions