lazy llama
Well-known member
As per the documentation, I have a line in my config.php:
When I run something like 'php cmd.php help', PHP barfs:
Presumably this is because when PHP is run at the command line it doesn't have valid info in $_SERVER['REMOTE_ADDR'] and so freaks out (technical term) and tries to reload the config.
If this a known feature? Is there a better way to manage turning on debug (given you may want to debug a non-logged-in session)?
Commenting out the line in config.php makes everything run at the CLI again, so it's not a terrible thing to work around.
Code:
if ($_SERVER['REMOTE_ADDR'] == '<myhomeip>') {$config['debug'] = true;}
When I run something like 'php cmd.php help', PHP barfs:
Code:
# php cmd.php list
PHP Fatal error: Uncaught Error: Attempted to recursively load configuration file in /pathtoboards/src/XF/App.php:261
Stack trace:
#0 /pathtoboards/src/XF/Container.php(33): XF\App->XF\{closure}(Object(XF\Container))
#1 /pathtoboards/src/XF/App.php(760): XF\Container->offsetGet('...')
#2 /pathtoboards/src/XF/Container.php(33): XF\App->XF\{closure}(Object(XF\Container))
#3 /pathtoboards/src/XF/App.php(2983): XF\Container->offsetGet('...')
#4 /pathtoboards/src/XF/Error.php(91): XF\App->db()
#5 /pathtoboards/src/XF/App.php(2837): XF\Error->logException(Object(ErrorException), true, '')
#6 /pathtoboardsr/src/XF.php(249): XF\App->logException(Object(ErrorException), true)
#7 [internal function]: XF::handleException(Object(ErrorException))
#8 {main}
thrown in /pathtoboards/src/XF/App.php on line 261
PHP Fatal error: Uncaught Error: Attempted to recursively load configuration file in /pathtoboards/src/XF/App.php:261
Stack trace:
#0 /pathtoboards/src/XF/Container.php(33): XF\App->XF\{closure}(Object(XF\Container))
#1 /pathtoboards/src/XF/App.php(760): XF\Container->offsetGet('...')
#2 /pathtoboards/src/XF/Container.php(33): XF\App->XF\{closure}(Object(XF\Container))
#3 /pathtoboards/src/XF/App.php(2983): XF\Container->offsetGet('...')
#4 /pathtoboards/src/XF/Error.php(91): XF\App->db()
#5 /pathtoboards/src/XF/App.php(2837): XF\Error->logException(Object(ErrorException), true, '')
#6 /pathtoboards/src/XF.php(287): XF\App->logException(Object(ErrorException), true)
#7 [internal function]: XF::handleFatalError()
#8 {main}
thrown in /pathtoboards/src/XF/App.php on line 261
Presumably this is because when PHP is run at the command line it doesn't have valid info in $_SERVER['REMOTE_ADDR'] and so freaks out (technical term) and tries to reload the config.
If this a known feature? Is there a better way to manage turning on debug (given you may want to debug a non-logged-in session)?
Commenting out the line in config.php makes everything run at the CLI again, so it's not a terrible thing to work around.