XF 1.3 AdminCP always logged out

Adam Howard

Well-known member
I've been having a bit of an issue with AdminCP. I'm continuously and randomly logged out. I had a hard time even installing an add-on, because I kept getting logged out during the rebuild.

If anyone knows away to force remaining logged in, I'd love to know it.
 
Few things...

1) Not suing cloudflare or any proxy
2) Not currently cache sessions (though would very much like to do so)
3) IP address is the same when viewing info.php

Thoughts on what else could cause this?
 
This is what is currently in my config.php

PHP:
<?php
// Requirements
$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'user-name';
$config['db']['password'] = 'password';
$config['db']['dbname'] = 'data-base-name';
$config['superAdmins'] = 'X,X,X';
// Cookieless domain + CDN
$config['javaScriptUrl'] = 'http://cdn.sociallyuncensored.com/js';
$config['externalDataUrl'] = 'http://cdn.sociallyuncensored.com/data';
// System Cache
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'su_';
// Session Cache
// $config['cache']['cacheSessions'] = true;
// Backend Cache
$config['cache']['backend'] = 'xcache';
//
// Disable ALL add-ons
// $config['enableListeners'] = false;
// Enable debug mode
// $config['debug'] = 1;
// Display ALL errors (if any)
// ini_set('display_errors', true);
 
The only time I've seen this is when the IP has been changing (dramatically). I guess it could also happen if the session was terminated for some reason, but why that would happen is a question that I can't answer.

Stupid question, but does it happen if all addons are disabled?
 
You have ZendOpcache and Xcache enabled:
Code:
PHP 5.5.12-2+deb.sury.org~trusty+1 (cli) (built: May 12 2014 13:48:43)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo

Need to pick one or the other
 
You have ZendOpcache and Xcache enabled:
Code:
PHP 5.5.12-2+deb.sury.org~trusty+1 (cli) (built: May 12 2014 13:48:43)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo

Need to pick one or the other
Really? I was under the impression you could use both. Just like how you could use APC with something else (memcache) as they each did something differently.

I guess I would pick ZendOpcache if I knew how to get that working in my config.php
 
In that case, disable zendopcache, and use xcache, as that can do both.
@MattW there tons of post here where people use both... I would like them divided. One simply dedicated only to opcode caching and one for caching the front, back, and session.

Recall that is what was done with APC and whatever cache people had picked (xcache or memcache). So why has this changed?
 
@MattW there tons of post here where people use both... I would like them divided. One simply dedicated only to opcode caching and one for caching the front, back, and session.

Recall that is what was done with APC and whatever cache people had picked (xcache or memcache). So why has this changed?
It hasn't. I've not seen anyone use Xcache with ZendOpcache.

Yes, people (including myself), have used Xcache for opcaching, and memcached for the sessions (I currently use ZendOpcache with Memcached myself), or zendopcache and APCu on PHP5.5, but I've not seen anyone use the combination you are suggesting you want to try.

EDIT:

Common setups

APC (opcache and session)
Xcache (opcache and session)
ZendOpcache + Memcached
ZendOpcache + APCu
 
It hasn't. I've not seen anyone use Xcache with ZendOpcache.

Yes, people (including myself), have used Xcache for opcaching, and memcached for the sessions (I currently use ZendOpcache with Memcached myself), or zendopcache and APCu on PHP5.5, but I've not seen anyone use the combination you are suggesting you want to try.

EDIT:

Common setups

APC (opcache and session)
Xcache (opcache and session)
ZendOpcache + Memcached
ZendOpcache + APCu
So you can mix and match (I knew this). But I have never been told you cannot use xcache with anything else.

ZendOpcache = for opcode
xcache = for backend, front end, and sessions.

This is what I wanted to use. And it's been working fine. It's only recently that I've been having problems keeping logged into AdminCP.

So I'm wondering what is the difference between XenForo's forum side vs AdminCP when it comes to login. Because I have no issue staying logged into the forum, only the admincp.

The only difference I can think of is I have admin.php password protected using htpasswd
 
So you can mix and match (I knew this). But I have never been told you cannot use xcache with anything else.

ZendOpcache = for opcode
xcache = for backend, front end, and sessions.

This is what I wanted to use. And it's been working fine. It's only recently that I've been having problems keeping logged into AdminCP.

So I'm wondering what is the difference between XenForo's forum side vs AdminCP when it comes to login. Because I have no issue staying logged into the forum, only the admincp.

The only difference I can think of is I have admin.php password protected using htpasswd
Are you sure it's been working? You opcache.ini file is empty, so there is nothing actually configured in it, apart from enabling the extension.
Code:
; configuration for php ZendOpcache module
; priority=05
zend_extension=opcache.so
There is no memory allocated to it, so it's not going to be storing anything.

That being the case, it might be something as simple as you are running out of space in the cache, and need to increase it in the xcache.ini file.
Code:
cat 20-xcache.ini | grep size
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size  =               60M
xcache.var_size  =            4M
 
Are you sure it's been working? You opcache.ini file is empty, so there is nothing actually configured in it, apart from enabling the extension.
Code:
; configuration for php ZendOpcache module
; priority=05
zend_extension=opcache.so
There is no memory allocated to it, so it's not going to be storing anything.

That being the case, it might be something as simple as you are running out of space in the cache, and need to increase it in the xcache.ini file.
Code:
cat 20-xcache.ini | grep size
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size  =               60M
xcache.var_size  =            4M
Huh... Well now I'm confused. I was told (read) countless times that you did not need to configure ZendOpcache and that enabling it was good enough (quick search shows that advice over and over). ..... I'm only good as the information I have. lol :p

Any suggested values for the zend?
 
Huh... Well now I'm confused. I was told (read) countless times that you did not need to configure ZendOpcache and that enabling it was good enough (quick search shows that advice over and over). ..... I'm only good as the information I have. lol :p

Any suggested values for the zend?
You don't need to configure it for XenForo, but you DO need to configure it to work with PHP itself.

This is mine on my debian box with the same RAM as yours.
Code:
; configuration for php ZendOpcache module
; priority=05
zend_extension=opcache.so
opcache.enable=1
opcache.memory_consumption=512
opcache.interned_strings_buffer=8
opcache.max_wasted_percentage=5
opcache.max_accelerated_files=8000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=0
opcache.save_comments=1
opcache.enable_file_override=1
opcache.validate_timestamps=1
 
Well good news is my xcache.ini is not empty at all. :p

This is what is there
PHP:
; configuration for php Xcache module

[xcache-common]
;; non-Windows example:
extension = xcache.so
;; Windows example:
; extension = php_xcache.dll

[xcache.admin]
xcache.admin.enable_auth = On
; Configure this to use admin pages
; xcache.admin.user = "mOo"
; xcache.admin.pass = md5($your_password)
; xcache.admin.pass = ""

[xcache]
; ini only settings, all the values here is default unless explained

; select low level shm implemenation
xcache.shm_scheme =        "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size  =               60M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count =                 1
; just a hash hints, you can always store count(items) > slots
xcache.slots =                8K
; ttl of the cache item, 0=forever
xcache.ttl   =                 0
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval =           0

; same as aboves but for variable cache
xcache.var_size  =            4M
xcache.var_count =             1
xcache.var_slots =            8K
; default value for $ttl parameter of xcache_*() functions
xcache.var_ttl   =             0
; hard limit ttl that cannot be exceed by xcache_*() functions. 0=unlimited
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300

; mode:0, const string specified by xcache.var_namespace
; mode:1, $_SERVER[xcache.var_namespace]
; mode:2, uid or gid (specified by xcache.var_namespace)
xcache.var_namespace_mode =    0
xcache.var_namespace =        ""

; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory. (auto create/overwrite)
; Use something like "/tmp/xcache" instead of "/dev/*" if you want to turn on ReadonlyProtection
; different process group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path =    "/dev/zero"


; Useful when XCache crash. leave it blank(disabled) or "/tmp/phpcore/" (writable by php)
xcache.coredump_directory =   ""
; Windows only. leave it as 0 (default) until you're told by XCache dev
xcache.coredump_type =         0

; disable cache after crash
xcache.disable_on_crash =    Off

; enable experimental documented features for each release if available
xcache.experimental =        Off

; per request settings. can ini_set, .htaccess etc
xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =           Off

[xcache.coverager]
; enabling this feature will impact performance
; enabled only if xcache.coverager == On && xcache.coveragedump_directory == "non-empty-value"

; per request settings. can ini_set, .htaccess etc
; enable coverage data collecting and xcache_coverager_start/stop/get/clean() functions
xcache.coverager =          Off
xcache.coverager_autostart =  On

; set in php ini file only
; make sure it's readable (open_basedir is checked) by coverage viewer script
xcache.coveragedump_directory = ""

However, you guessed right about the opcache.ini being virtually empty

PHP:
; configuration for php ZendOpcache module
; priority=05
zend_extension=opcache.so
 
Top Bottom