1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 AdminCP always logged out

Discussion in 'Troubleshooting and Problems' started by Adam Howard, Jun 1, 2014.

  1. Adam Howard

    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.
  2. Adam Howard

    Adam Howard Well-Known Member

    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?
  3. Adam Howard

    Adam Howard Well-Known Member

    This is what is currently in my config.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);
  4. Adam Howard

    Adam Howard Well-Known Member

    Attached Files:

  5. Liam W

    Liam W Well-Known Member

    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?
  6. RoldanLT

    RoldanLT Well-Known Member

    Something to do with XCache?
  7. MattW

    MattW Well-Known Member

    You have ZendOpcache and Xcache enabled:
    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
    SneakyDave likes this.
  8. Adam Howard

    Adam Howard Well-Known Member

    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
  9. MattW

    MattW Well-Known Member

    What are you wanting to use it for? Just the opcode caching?
    Adam Howard likes this.
  10. Adam Howard

    Adam Howard Well-Known Member

    Yes. :)
  11. MattW

    MattW Well-Known Member

    You don't need to do anything in that case, zendopcache works without any config required in your config.php file for XenForo.
    RoldanLT likes this.
  12. Adam Howard

    Adam Howard Well-Known Member

    So what can I put in my config.php to cache both the front end, backend, and session cache? Was looking to xcache for that.
  13. MattW

    MattW Well-Known Member

    In that case, disable zendopcache, and use xcache, as that can do both.
  14. Adam Howard

    Adam Howard Well-Known Member

    @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?
  15. MattW

    MattW Well-Known Member

    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.


    Common setups

    APC (opcache and session)
    Xcache (opcache and session)
    ZendOpcache + Memcached
    ZendOpcache + APCu
    Tracy Perry and Adam Howard like this.
  16. Adam Howard

    Adam Howard Well-Known Member

    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
  17. MattW

    MattW Well-Known Member

    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.
    ; configuration for php ZendOpcache module
    ; priority=05
    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.
    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
    Adam Howard likes this.
  18. Adam Howard

    Adam Howard Well-Known Member

    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?
  19. MattW

    MattW Well-Known Member

    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.
    ; configuration for php ZendOpcache module
    ; priority=05
    Adam Howard likes this.
  20. Adam Howard

    Adam Howard Well-Known Member

    Well good news is my xcache.ini is not empty at all. :p

    This is what is there
    configuration for php Xcache module

    non-Windows example:
    extension xcache.so
    ;; Windows example:
    extension php_xcache.dll

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

    ini only settingsall the values here is default unless explained

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

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

    mode:0, const string specified by xcache.var_namespace
    mode:2uid or gid (specified by xcache.var_namespace)
    xcache.var_namespace_mode =    0
    .var_namespace =        ""

    N/for /dev/zero
    .readonly_protection Off
    ; for *nixxcache.mmap_path is a file pathnot 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
    .coredump_type =         0

    disable cache after crash
    .disable_on_crash =    Off

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

    per request settingscan ini_set, .htaccess etc
    .cacher =               On
    .stat   =               On
    .optimizer =           Off

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

    per request settingscan ini_set, .htaccess etc
    enable coverage data collecting and xcache_coverager_start/stop/get/clean() functions
    .coverager =          Off
    .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

    configuration for php ZendOpcache module

Share This Page