I'm looking for a way to enable php error reporting only for my own IP. My IP changes but I have a DDNS (dynamic DNS) address which points to my actual IP. This solution is not for productional usage. I just want to be able to debug a remote server without providing the errors to everybody in the internet.
Idea was to use some kind of <If...>
directive where I check if the IP is my DDNS IP or to use a RewriteRule
. For the RewriteRules
I need to input a real IP and no DDNS domain. The reverse lookup for the domain will fail too, because I cannot control the rDNS.
Any ideas what I can try?
Why not in PHP ?
if($_SERVER['REMOTE_ADDR'] = 'your ip') {
ini_set('display_errors', 1);
error_reporting(E_ALL);
}
Edit: If you want to do something with the hostname attached to that IP address, just add gethostbyaddr() or gethostbyname() in your if-statement. (which one of the two you want to use depends if you want to check on IP or on hostname)
if(gethostbyaddr($_SERVER['REMOTE_ADDR']) == 'my hostname') { .. same code }