Gentoo Archives: gentoo-server

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

Replies

Subject Author
Re: [gentoo-server] handling syntax/parse errors with PHP Brian Kroth <bpkroth@××××.edu>