Gentoo Archives: gentoo-server

From: Brian Kroth <bpkroth@××××.edu>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] handling syntax/parse errors with PHP
Date: Tue, 27 Nov 2007 19:45:44
Message-Id: 20071127194138.GC10284@bpkroth-tux.hslc.wisc.edu
In Reply to: Re: [gentoo-server] handling syntax/parse errors with PHP by Jil Larner
1 Definitely look at the php.ini. Also, you might want to have a look at this:
2
3 http://www.modsecurity.org/
4
5 It has output filtering and a nice set of "Core Rules" that I think might even
6 have an option for things like this. There's quite a lot of neat tricks you
7 can do with it.
8
9 Brian
10
11 Jil Larner <jil@××××.eu>:
12 > -----BEGIN PGP SIGNED MESSAGE-----
13 > Hash: SHA1
14 >
15 > Hello,
16 >
17 > In theory, a production server shouldn't have files with parse errors.
18 > It may be why there's no easy way to handle such an error. So I cannot
19 > give you the way to show a custom error page.
20 > But, for the second point, you may use php.ini' setting like log_errors,
21 > error_log (the logfile path), and ignore_repeated_errors in order to
22 > keep a little file. So you can parse this file and then send a mail, or
23 > whatever you want to do with errors.
24 >
25 > I hope it can help you. If you find a way to redirect on such error,
26 > i'll be happy to know how to do ;)
27 >
28 > Jil Larner.
29 >
30 > Andrew Gaffney a écrit :
31 > > In my PHP-based websites for work, I have some error handling code that
32 > > captures any errors, displays a "friendly" error page, and then sends me
33 > > an email with all the details about the error.
34 > >
35 > > However, this doesn't work for syntax/parse errors in pages, since the
36 > > code is not actually executed in this case. I can't seem to find
37 > > anything online about capturing these errors and notifying myself somehow.
38 > >
39 > > Does anyone do something like this already?
40 > >
41 > -----BEGIN PGP SIGNATURE-----
42 > Version: GnuPG v1.4.7 (GNU/Linux)
43 >
44 > iD8DBQFHTG0gMBDlpRaep+4RAjlaAKDa872UZIwZ7SLglKduspga3P7rYACg1jk+
45 > NHCZWsPT5Y2UAJJgk+Gm8Yk=
46 > =qkrR
47 > -----END PGP SIGNATURE-----
48 > --
49 > gentoo-server@g.o mailing list
50 >

Attachments

File name MIME type
smime.p7s application/x-pkcs7-signature