Is there a way to disable error reporting when my site is on my actual host where people can view it and enable it when I'm just working on it locally on my usb webserver?
I find it a pain to constantly toggle between error_reporting(1) and (0) whenever I want to debug. I have it set in my connection file which is included on every page on my website btw
EDIT: Ended up adding this to my connection file
$addrip = $_SERVER['REMOTE_ADDR'];
if($addrip == "::1" || $addrip == "127.0.0.1" ){
error_reporting(0);
}else{
error_reporting(1);
}
php.inifile in that way if you have access to it on your actual host. Do you?.htaccessfile though: stackoverflow.com/questions/8652933/…if ($_SERVER['HTTP_HOST'] == 'localhost'){...} else{...}- or$whitelist = array( '127.0.0.1' ); if(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){ // not valid }