While there may be other forms of documentation indicating how to install the memcache extension, the first place that many will look is in the module directory. There, INSTALL.txt desperately needs an update.

It provides invalid paths as examples, using sites/default/modules (which doesn't exist), or referencing *.inc files from sites/default/settings.php as "./include/*.inc", etc. For new administrators, this is frustrating.

Basically, the INSTALL.txt file appears as though it was hastily written, and written for a prior version of drupal.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JeffSheltren’s picture

Assigned: Unassigned » JeffSheltren
Status: Active » Needs review
FileSize
9.23 KB

I've updated the README.txt for 7.x, and we can probably apply most of the changes to the 6.x README, but I'll wait for some review before working on that.

I recommend that we get rid of INSTALLATION.txt and instead rely on only the README.txt and we can reference online docs as needed. If that's not an option, I can work on updating INSTALLATION.txt as well.

Patch attached with proposed README changes.

Tim Jones Toronto’s picture

Thanks Jeff!

I agree with the idea to get rid of INSTALLATION.txt as you suggest.

Do we need to make mention to set memcache.hash_strategy="consistent" in PHP.INI extension e.g:

extension=memcached.so
memcache.hash_strategy="consistent"

or is this now not needed?

JeffSheltren’s picture

Tim, I had intended to included a section on multiple servers but I forgot -- thanks for the reminder! See attached for an updated patch which includes a section describing setting 'consistent' hash strategy for multiple memcached servers.

quicksketch’s picture

Title: INSTALL.txt needs to be updated... » Update README.txt for Drupal 7, remove INSTALLATION.txt
FileSize
12.62 KB

Thanks @JeffSheltren for this significant update. I have to curse at Memcache module every time I install it on D7 because there aren't any instructions that are all in one place. This patch needed a reroll due to some conflicts, so I read through it all (sounds great!) and made a few more adjustments.

Instead of using examples like:

$conf = array(
  ...
  'memcache_servers' => array(
    'localhost:11211' => 'default',
  );
);

I switched all the examples to:

$conf['memcache_servers'] = array(
  'localhost:11211' => 'default',
);

Making it so you can just copy/paste into settings.php anywhere. The settings.php file in D7 now individually sets variables within $conf one at a time, rather than using one big $conf = array(), we should do the same for consistency and ease.

Updating the title of this issue, it'd be great to remove the INSTALLATION.txt file also, almost all information there no longer applies since you can just yum/apt-get install memcached these days, no need for specific repositories.

Tim Jones Toronto’s picture

Hi Jeff,

I forgot to post back on this sorry. I checked the work you did and it looks great.

Agree with the $conf changes, thanks @quicksketch.

This is a great update for setting up this module.

Thanks all!

imoreno’s picture

Hi,
just wanted to say that i have installed memcash today using the readme file only and it went OK.
so if this worth something i can say the current version is helpful,

Itzhak

mgifford’s picture

I think this is a bit better than the older Lullabot article, but do really think that there should be a link to
http://www.thefanclub.co.za/how-to/how-install-memcached-on-ubuntu-for-d...

But a point back to the handbook is pretty essential - http://drupal.org/node/1131468

Think it's better to point folks to:
+ $conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';

These docs definitely need a clean up, along with the handbook. Lots of places where I'm not sure how D6 & D7 differ.

helmo’s picture

@quicksketch: neither patch nor git apply manage to apply your patch from #4. On which git version did you base this?

helmo’s picture

#1452966: INSTALLATION.txt outdated and redundant already addresses removing the INSTALLATION.txt

helmo’s picture

I've noticed that the patch from #3 still applies just fine.

So I guess that the reason why @quicksketch thought he needed a reroll was some local change in code.

I've gone ahead and updated the pacth from #3 with the comments @quicksketch made in #4.

Please review and get this committed quickly to avoid more confusion.

helmo’s picture

and now with the patch actually attached :)

Jeremy’s picture

Status: Needs review » Fixed

Thanks! It didn't apply cleanly anymore, but I manually fixed that and did a little more cleanup. Committed:
http://drupalcode.org/project/memcache.git/commit/d341d88

quicksketch’s picture

Thanks @Jeremy!

Jeremy’s picture

Version: 7.x-1.0 » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Re-opening -- the same cleanup should be done to the 6.x documentation.

asb’s picture

Issue summary: View changes

Coming from #1014154: Incorrect documentation in README.txt because after installaion I got

PHP Fatal error: Class 'MemCacheDrupal' not found in /var/www/d7/includes/cache.inc on line 31 […]

As instructed in the closed issue, I had to use:

include_once DRUPAL_ROOT . '/includes/cache.inc';
include_once DRUPAL_ROOT . '/sites/all/modules/memcache/memcache.inc';

This resultes in an PHP Fatal error:

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';

Jeremy’s picture

Please see step #7 in INSTALL.txt where it states:

 7. Edit settings.php to make memcache the default cache class, for example:
      $conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
      $conf['cache_default_class'] = 'MemCacheDrupal';
    The cache_backends path needs to be adjusted based on where you installed
    the module.

In your case, it sounds like you've put the memcache module somewhere else (sites/default or sites/all/contrib for example).

asb’s picture

No, 'memcache.inc' ist at ./sites/all/modules/memcache/memcache.inc.

The point of my post was that I did follow the installation instructions and got an PHP Fatal error and a WSOD for that. The workaround is in a closed issue (#1014154) that points here with the purpose to fix the installation instructions.

JeffSheltren’s picture

@asb, if you were getting a WSOD with the suggested configuration, then it's likely that something else is wrong with your installation/settings. I can verify that using:

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';

Works for me on multiple D7 sites.

If you're unable to get that to work, I suggest opening up a new issue for support.

asb’s picture

@JeffSheltren: First I didn't notice the PHP Fatal error after enabling the memcache module; it does not cause a WSOD by itself, but it's in the logfiles (Drupal's watchdog and the webservers error.log). The WSOD came up in combination with a reverse proxy (Varnish). When investigating this WSOD, I came across the PHP Fatal error caused by the memcache module. After I applied the workaround from #1014154, the PHP Fatal error is gone, and varnish module can be enabled.

So varnish module was just an indicator for the broken configuration of memcache module, it does not cause the PHP Fatal error, but trying to enable varnish module caused a WSOD because of memcache's PHP Fatal error.

From my ./sites/default/settings.php:

$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
// $conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
include_once DRUPAL_ROOT . '/includes/cache.inc';
include_once DRUPAL_ROOT . '/sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_servers'] = array(
  '127.0.0.1:11211' => 'default',
  'XX.XX.XX.XX:11211' => 'default', 
);
$conf['memcache_bins'] = array(
  'cache' => 'default',
  'cache_form' => 'database',
);
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
$conf['lock_inc'] = 'sites/all/modules/memcache/memcache-lock.inc';
$conf['memcache_stampede_protection'] = TRUE;
$conf['memcache_key_prefix'] = 'XX;
$conf['memcache_key_hash_algorithm'] = 'sha1';

Check if memcache.inc is at it's expected location, from the site's root folder:

$ ls sites/all/modules/memcache/memcache.inc
sites/all/modules/memcache/memcache.inc
JeffSheltren’s picture

@asb, like I said, the configuration as described in the 7.x README is considered correct. If it's not working for you, then the best thing to do is open up a new issue to track the problem.

asb’s picture

Re-opening #1014154: Incorrect documentation in README.txt to fix "Incorrect documentation in README.txt" which points to this issue.

Jeremy’s picture

Status: Patch (to be ported) » Fixed

  • Jeremy committed dbce2d5 on 6.x-1.x
    Issue #1536222: backport README cleanups from D7
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.