Support » Plugin: Slimstat Analytics » "misconfigured setting and/or server environment" on Debian 6.0 (I read the FAQ)

  • Resolved jpod


    First of all, thanks for your great plugin. Unfortunately, I’m encountering the following problem:

    Your plugin reports the following warning:

    WARNING: a misconfigured setting and/or server environment is preventing WP SlimStat from properly tracking your visitors. Please check the FAQs for more information.

    I did check the FAQ, though I wondered why WP SlimStat could not find my wp-config.php, which lies in /etc/wordpress and is symlinked from there into the root directory of my WordPress installation.

    Using wp-slimstat-config.php to set $wp_config_path to /etc/wordpress/wp-config.php, however, made no difference at all.

    From the error message I got, “error parsing wp-config.php” or something along these lines, I conjectured that your plugin might be looking for some information in wp-config.php that just isn’t present, likely because of the way the Debian GNU/Linux WordPress package handles multi-site setups. Namely, Debian GNU/Linux ships with a WordPress package that is modified so that its wp-config.php sets some general options and then, depending on the current value of the $HTTP_HOST environement variable, loads site-specific settings from an external file.

    The relevant portion of my wp-config.php thus reads:

    /* Look up a host-specific config file in
     * /etc/wordpress/config-<host>.php or /etc/wordpress/config-<domain>.php
    $debian_server = preg_replace('/:.*/', "", $_SERVER['HTTP_HOST']);
    $debian_server = preg_replace("/[^a-zA-Z0-9.\-]/", "", $debian_server);
    $debian_file = '/etc/wordpress/config-'.strtolower($debian_server).'.php';
    /* Main site in case of multisite with subdomains */
    $debian_main_server = preg_replace("/^[^.]*\./", "", $debian_server);
    $debian_main_file = '/etc/wordpress/config-'.strtolower($debian_main_server).'.php';
    if (file_exists($debian_file)) {
        define('DEBIAN_FILE', $debian_file);
    } elseif (file_exists($debian_main_file)) {
        define('DEBIAN_FILE', $debian_main_file);
    } elseif (file_exists("/etc/wordpress/config-default.php")) {
        define('DEBIAN_FILE', "/etc/wordpress/config-default.php");
    } else {
        header("HTTP/1.0 404 Not Found");
        echo "Neither <b>$debian_file</b> nor <b>$debian_main_file</b> could be found. <br/> Ensure one of them exists, is readable by the webserver and contains the right password/username.";

    Thus, I figured I could just adopt my wp-slimstat-config.php accordingly. This is what I came up with:

    $debian_server = preg_replace('/:.*/', "", $_SERVER['HTTP_HOST']);
    $debian_server = preg_replace("/[^a-zA-Z0-9.\-]/", "", $debian_server);
    $debian_file = '/etc/wordpress/config-'.strtolower($debian_server).'.php';
    /* Main site in case of multisite with subdomains */
    $debian_main_server = preg_replace("/^[^.]*\./", "", $debian_server);
    $debian_main_file = '/etc/wordpress/config-'.strtolower($debian_main_server).'.php';
    if (file_exists($debian_file)) {
            $wp_config_path = $debian_file;
    } elseif (file_exists($debian_main_file)) {
            $wp_config_path = $debian_main_file;
    } elseif (file_exists("/etc/wordpress/config-default.php")) {
            $wp_config_path = "/etc/wordpress/config-default.php";

    Now, when I invoke wp-slimstat-js.php directly, I get:

    -105 : invalid data format

    According to your FAQ this is the error message I should be getting, but when I invoke wp-admin/admin.php?page=wp-slimstat/admin/options/index.php&slimpanel=6, i.e., the maintenance tab in the settings panal of your plugin, I still get the “misconfigured setting and/or server environment” warning described above. Any hints?

    Thanks for taking the time!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Jason Crouse


    Hi there,

    thank you for spending some time in investigating the issue a little further, and not posting the usual message “Help, your plugin doesn’t work” 🙂

    WP SlimStat tries to parse your wp-config.php to get the params to connect to the database without having to load the entire core.

    I love the way you modified your wp-slimstat-config.php, and I will definitely link this thread from the FAQs, so that others can follow your lead.

    The misconfigured setting error should go away once a pageview is correctly tracked. If this is not your case, you may want to try to enable its JavaScript Mode option, and see if things change.

    If that still doesn’t help, contact me and I’ll be happy to take a look at your environment

    la buca delle lettere

    Thank you,

    Hi Camu,

    thanks for your prompt reply (and thanks for the compliment, but you’re volunteering your time, so doing some investigation into my issues before reporting them is the least I can do). Indeed, the error message did go away at some point. Still, if JavaScript Mode is enabled, no page views are tracked (CDN is disabled). That might be a separate issue though, it’s hard to tell.

    I had a look on the Apache and MySQL logs, but found nothing out of the ordinary.

    If it’s any help, the website I’m talking about is:

    And for the record, we’re running:

    Operating System

    Debian GNU/Linux 6.0.6
    Kernel 2.6.32-5-xen-amd64


    Server version: Apache/2.2.16 (Debian)
    Server built: Nov 30 2012 08:58:38
    Server’s Module Magic Number: 20051115:24
    Server loaded: APR 1.4.2, APR-Util 1.3.9
    Compiled using: APR 1.4.2, APR-Util 1.3.9
    Architecture: 64-bit
    Server MPM: ITK
    threaded: no
    forked: yes (variable process count)
    Server compiled with….
    -D APACHE_MPM_DIR=”server/mpm/experimental/itk”
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D HTTPD_ROOT=”/etc/apache2″
    -D SUEXEC_BIN=”/usr/lib/apache2/suexec”
    -D DEFAULT_PIDLOG=”/var/run/”
    -D DEFAULT_SCOREBOARD=”logs/apache_runtime_status”
    -D DEFAULT_LOCKFILE=”/var/run/apache2/accept.lock”
    -D DEFAULT_ERRORLOG=”logs/error_log”
    -D AP_TYPES_CONFIG_FILE=”mime.types”
    -D SERVER_CONFIG_FILE=”apache2.conf”


    mysql Ver 14.14 Distrib 5.1.66, for debian-linux-gnu (x86_64) using readline 6.1


    PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 14:18:06)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

    Thanks again

    Plugin Author Jason Crouse


    Weird, for what I can tell, my visits were tracked without any problems.

    That’s because JavaScrit Mode was disabled; it’s now turned on again.

    Oh, and I’m using WP SlimStat 2.9.1.

    Plugin Author Jason Crouse


    Okay thanks, I see that it throws the error

    Fatal error: Call to undefined function date_i18n() in…

    This is probably happening for the same reason other users were experiencing conflicts with other plugins. I got some good feedback and I’m planning to rewrite this piece of the engine to follow a completely different approach.

    In the meanwhile, in your case, JS Mode won’t work unless you can figure out why date_i18n is not defined.


    Thanks a lot, I’ll have a look into why this happens. Right now, it’s just confusing, the other plugins that call date_i18n() seem to work fine. I’ll see whether I can figure out which other plugin is causing the trouble and will let you know.

    Plugin Author Jason Crouse


    It may be a problem of function SCOPE, because of the way I implemented the new JS tracker. I was trying to optimize things, but I probably optimized too much (and as everybody knows, premature optimization is the root of all evils!). I’ll go back to a more conservative approach, which should take care of most of these issues. And it should make WP’s core developers happy, too.

    Thank you

    Thanks, for now I’ll just disable JaveScript Mode. I tried to deactivate all other plugins, but that made no difference (and I can’t tamper with the theme right now, the site just went live).

    Plugin Author Jason Crouse



    I have the new engine in place, which doesn’t require any of the hacks needed to make the previous version work: no wp-slimstat-config, no tricks, just install and go, no matter where your wp-config is and how it’s loaded. Would you like to test it? You know where to contact me 😉


    So I spent an entire 10min in development of my wp-slimstat-config.php in vain ;-)? Great to hear. Yes, of course I’d like to test it :). I was about to file another bug at any rate, which may or may not be connected to this one (namely, that all tabs safe for the current stats remain empty), but I’ll just see if the new engine fixes this one at well. Thanks for the fast help!

    Plugin Author Jason Crouse


    Hi there, I hope the new version will help you forgive me for wasting 10 minutes of your life 😛

    Contact me at your earliest convenience (see link in one of the messages here above) referencing this thread, and I will send it to you.


Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘"misconfigured setting and/or server environment" on Debian 6.0 (I read the FAQ)’ is closed to new replies.