Support » Plugin: WP-FFPC » [Plugin: WP-FFPC] Errors

  • Resolved athalas



    Haven’t been able to get the plugin working.

    WordPress 3.3.1
    Nginx-1.0.12 (with config for nginx to utilize the data entries)
    Memcached 1.4.13
    PHP 5.3.10 with memcache 3.0.6 extension
    APC 3.1.9

    with ‘use memcached server with Memcache extension’, wsod is returned the following php error:

    PHP Fatal error: Call to a member function get() on a non-object in ../wp-content/plugins/wp-ffpc/wp-ffpc-common.php on line 182

    Back-end status message “Memcached server status: down” – although the Host and port is configured correct)

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author petermolnar


    Hi athalas,

    I’ve commited some bigfixes a few minutes ago, please give a try if it solved the problem.


    Hi Peter,

    Thanks for the reply!

    I’ve network enabled it on one of my test sites, the above issues appears to have been resolved, but when I reload the page to load the cached page my images break, do you have an example WordPress MS Nginx config available.

    Here is mine for your reference:

    location / {
    try_files $uri $uri/ @memcached;

    location @memcached {
    default_type text/html;

    set $memcached_key data-$host$request_uri;
    error_page 404 = @rewrites;

    location @rewrites {
    rewrite ^(.*)$ /index.php?q=$1 last;

    rewrite /wp-admin$ $scheme://$host$uri/ permanent;

    rewrite /files/$ /index.php last;

    location ^~ /files/ {
    rewrite ^.*/files/(.+)$ /wp-includes/ms-files.php?file=$1 last;

    if (!-e $request_filename) {
    rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
    rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
    rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;

    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass php;

    Doesn’t appear to be limited to the images, when I reload a page it simply outputs a full screen of random characters, example:

    xœí}ksÛ8²èg»jþF©9gCIÔ[v¬9Žãd²›×ÚžÍΙ™rA$$1¡H V”œTÝ¿qÿÞý%·»¾$êe1™ÙÍIv'”ýFh4}ÿäõùõÏo.Ø8˜ØìÍO_ýprx0bh>L@ŽY› a¡…5ǬKEÙ’4.#Ï ÁÁ·&|JG…{\Ô¶_5Ő‡v@ØTYÃòX'ž³‹[ôýµsnà ØüË‹ð½?º3aÛì®­ÙP2¦œ/þÆ‚Æ~¹¬°—g/þv¦ê£=1© ½ßÍq©ã—à½3˺ބT˜ñ€Åš êÙPcÓ¦æÇlƒFT« &ÕçOήÏ~9<@ † Úñé3°~Â@ OïþNc†ãž»Î Ip4ä¶/P ªÕß~ëCG‰ADˆ/µ- ¥±[+ðÚj*§é08°[ùZN¨7Ø“sGXêIc²Ñ¹O=x bõžµjß,%Ë𒝇~àN€÷s—1 ˆÊ>pÍ9û´¤œ¨›U\9õqÒ^«êõêåÛ›ÇÏ*念’©êà· ËÒ/¦®\¾=Ü)

    Plugin Author petermolnar


    Hi athlas,

    This was the problem why only the Memcache extension was able to work with nginx. By default, memcache stores the values compressed by zlib functions which make the entries inaccessable for nginx.
    I’ve tried turning of compression by setting server parameters with the Memcached extension using SetOption function (params here), yet without success.

    With the memcache ext. there’s a possibility to set the compression off but it may have been forced back somehow. The output you see is very likely the compressed entry in memcached.

    (I’d also like to add that the multisite files will not be stored and cached by the plugin, they can easily be too large and make suprisinly bad performance with that.
    Instead, I’d recommend the map module of nginx, just what I used as well.

    Anyway, to solve the problem: either somehow you’re using the Memcached plugin or even if the compression is turned off by the plugin, it somehow gets turned on again from a different source.
    Please take a look at php config memcache.ini file it there’s anything in it that may cause a problem like this.

    Plugin Author petermolnar


    Hi athalas,

    Could you get the plugin working at last?


    I had similar trouble with the Memcache extension, but it was intermittent.
    It seems memcache automatically compresses data once it hits a certain size – default is 20000 (units unknown – assume bytes?).
    I added a “SetCompressThreshold” value in line 62 of wp-ffpc-common.php and that solved the problem. Not very elegant, but worked in a pinch.

    54       case 'memcache':
     55          /* Memcache class does not exist, Memcache extension is not available */
     56          if (!class_exists('Memcache'))
     57                  return false;
     58          if ( $wp_ffpc_backend == NULL )
     59          {
     60                  $wp_ffpc_backend = new Memcache();
     61                  $wp_ffpc_backend->addServer( $wp_ffpc_config['host'] , $wp_ffpc_config['port'] );
     62                  $wp_ffpc_backend->setCompressThreshold(9999999, 0);
     63          }

    You may also specify a large threshold in php.ini

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP-FFPC] Errors’ is closed to new replies.