vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to supress errors in config.php except for a specific ip (https://vborg.vbsupport.ru/showthread.php?t=309985)

bzcomputers 03-28-2014 11:48 AM

How to supress errors in config.php except for a specific ip
 
I'd like to do some troubleshooting on a live 4.2.2 site. It currently has this in the config.php:
Code:

define('SKIP_ALL_ERRORS', true);
I'd like to bypass this for my specific id address so I can track down errors/warnings. I've tried something like this below:
Code:

if ($_SERVER['REMOTE_ADDR'] != 'xxx.xxx.xx.xx') { define('SKIP_ALL_ERRORS', true); }
...but it gives errors, I know I'm missing something obvious.

ozzy47 03-28-2014 11:55 AM

Lets try this:

Code:

$my_unique_ip="XXX.XXX.XX.X"; // Change this IP to your Unique IP.
if ($_SERVER["REMOTE_ADDR"]!=$my_unique_ip) define('SKIP_ALL_ERRORS', true);


nhawk 03-28-2014 11:57 AM

Either one of those should work.

What errors are you getting?

Remember, you're allowing errors to be shown to YOU when you do what you're doing. So yes... all sorts of errors can appear.

bzcomputers 03-28-2014 12:12 PM

Quote:

Originally Posted by nhawk (Post 2490023)
Either one of those should work.

What errors are you getting?

Looks like it was just the braces, once they were removed this worked:
Code:

if ($_SERVER['REMOTE_ADDR'] != 'xxx.xxx.xx.xx') define('SKIP_ALL_ERRORS', true);
Ozzy's works also.

Thanks.

ozzy47 03-28-2014 12:17 PM

Excellent, glad to hear. :)


All times are GMT. The time now is 11:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00949 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete