Configuring Drupal 7 settings.php with both Memcache and Varnish I am noob to using both Varnish and Memcached. I have been following some copy and paste install guides.

I have both servers installed and running. Memcached seems to be working fine. Varnish is serving pages but there are a lot of cache misses. I am trying to enable the Drupal module to make Varnish aware to cache the pages, the css etc.

However, when I copy the settings.php snippet from the README.txt file in the Varnish module to my own settings.php I get a white page and this message in the Apache error log:

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


Here is the cache section added to my settings.php. The Varnish part is commented out because it causes the above error with MemCached.

# Memcache
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
// The 'cache_form' bin must be assigned no non-volatile storage.
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_key_prefix'] = 'myhost';
# Varnish
// Add Varnish as the page cache handler.
#$conf['cache_backends'][] = array('sites/all/modules/contrib/varnish/varnish.cache.inc');
#$conf['cache_class_cache_page'] = 'VarnishCache';
// Drupal 7 does not cache pages when we invoke hooks during bootstrap.
// This needs to be disabled.
#$conf['page_cache_invoke_hooks'] = FALSE;


What is wrong with the Varnish snippet or with my setup in general?

I tried re-ordering to put the Varnish lines before the Memcached lines and I got this error:

PHP Fatal error:  require_once(): Failed opening required '/var/www/myhost/Array' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/myhost/includes/bootstrap.inc on line 2308
I got it a little bit later. It was just the array format being different in the two sources I copies and pasted from. The problem line was:

#$conf['cache_backends'][] = array('sites/all/modules/contrib/varnish/varnish.cache.inc');


It should be:

#$conf['cache_backends'][] = 'sites/all/modules/contrib/varnish/varnish.cache.inc';