views:

56

answers:

2

I understand that it is possible to alter the PHP error reporting level site-wide, but can I report a different error level to a particular client (IP address)?

+3  A: 

Yes:

if ($_SERVER["HTTP_HOST"] == "my.ip.address")
 error_reporting(my_custom_reporting_level);

if you want to display verbose error messages to an administrator, you might be better off with an authentication system though.

Pekka
+1 for the word of caution. Most, if not all, of the $_SERVER vars can be spoofed.
Mike B
A: 

It is possible natively as of PHP 5.3: http://php.net/ini.sections

Before that, you can manage it in the Vhost apache configuration.
SetEnv php_directive value

Savageman