Was trying once more to get these 2 modules to both work and was still getting this error:
Domain access failed to load during phase: 2. Please check your settings.php file and site configuration.
then i looked at the settings.inc file came across domain_settings_setup_ok():
function domain_settings_setup_ok() {
$state = &drupal_static(__FUNCTION__, NULL);
if ($state === NULL) {
$state = !function_exists('cache_get');
}
return $state;
}Figured that since the Memcache setup lines in settings.php came before the Domain Access settings.inc inclusion, cache_get() would already be defined by this point so domain_settings_setup_ok() is going to return FALSE, therefore i reversed the test for it.
Domain Access now bootstraps fine on my installation and everything seems to work ok so far on my test site with Domain Access handling 2 domains.
--Drupal throws up lots of errors when i try to include the Domain Access settings.inc before the Memcache inclusions. Keeping the settings.inc inclusion last with that change in domain_settings_setup_ok() is working for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 1240472-alt-cache-7-3.patch | 2.43 KB | agentrickard |
| #9 | 1240472-alt-cache-7-3.patch | 1.67 KB | agentrickard |
| #4 | 1240472-alt-cache-7-2.patch | 1.7 KB | agentrickard |
| #4 | 1240472-alt-cache-7-3.patch | 1.67 KB | agentrickard |
Comments
Comment #1
ben soo commented--i already reported this to the Memcache API issue queue.
Comment #2
agentrickardWe may be able to remove these lines entirely. They were a protection in D6 but may be clutter in D7.
Comment #3
agentrickardAt the least, perhaps, we change to see that $conf['cache_include'] hasn't been altered before running this check.
Comment #4
agentrickardThis might also affect 6.x.
Patches for 7.x.2 and 7.x.3 attached.
Comment #5
agentrickardComment #6
ben soo commentedUnfortch nope that didn't work for me. Same error:
Domain access failed to load during phase: 2. Please check your settings.php file and siteV7.x.3 patch didn't apply. The one that applied cleanly, with one line offset, was the V7.x.2 patch even tho i'm running the latest V7.x.3 from the module page here dated Jul.7. Straight from install settings.inc is dated 2008-10-06.
--Thank you for the fast response btw. i appreciate it very much and remember that from way back when i was messing with D5 you were just as quick with issues.
Comment #7
ben soo commented--any debugging you want me to do i'll comply-- proviso being i'm not a PHP dev as you folks certainly are so haven't any tools to use and remain clueless abt them.
Comment #8
agentrickardHow are you instantiating the memcache include?
/me doesn't have memcache.
Comment #9
agentrickardBad var name. See https://drupal.org/node/1131468.
New patch against 7.x.3. You may have to do a git pull first, since I committed two other patches today.
Comment #10
ben soo commentedMemcache API requires these 2 includes to work.
There are other directives but they for setting a default class for talking to the memcached daemon, and to configure the PHP memcache extension.
The above inclusions need to be above the Domain Access include or else Drupal throws up a lot of errors.
Comment #11
ben soo commentedi too clueless to describe that correctly. The other directives are like this:
Comment #12
ben soo commentedThese are the errors i see when i put the Domain Access inclusion before the Memcache API ones:
Comment #13
ben soo commentedi pulled and installed the latest V7.x.3.
This new patch doesn't work: if i reverse this test by removing the "!" then it loads.
if (!empty($conf['cache_inc'])) {altho i'm seeing this error here and there in the admin pages, /admin/appearance in this case:
Same error whether or not Memcache is installed.
Comment #14
ben soo commented--on the plus side, i'm suddenly seeing the Color Picker in appearance/settings/themename where before it wasn't there! i dunno whether to attribute this to the latest V7.x.3, my installation is very much in flux.
Comment #15
ben soo commentedStranger and stranger: i turned on a different PHP memcache extension (there're 2), and now these errors are gone.
Then i turned it off again leaving the old one, and those errors do not return.
OK, going to go do some other Drupally thing the rest of the day. This is messing with my head.
Comment #16
agentrickardWe probably just need to remove this check, then. The directive I was using is what's in the Memcache documentation, which is obviously out of date for Drupal 7.
Comment #17
agentrickardAnd a patch that removes that function.
NOTE: When a patch fails to resolve the issue, please set the issue to "Needs work".
Comment #18
ben soo commentedWorks!!!!!
!!!!!!!
Thank you agentrickard.
Am deep in the theming and site organisation, but after that i'll have to integrate multi-domains the way we need it, with every site's new content collected into one main front page, some common pages and a few shared areas and the possibility for users to register on multiple sites.
i'm sure at that point i'll be bugging you again. Hopefully i'll've figured enough out by then to leave out newbie stuff.
The other cache module i like is the D7 File Cache. That's pretty trouble free so far except it uses the same file system as everything else and that mightn't be a good idea for me once the load ramps up.
Will see.
Thanks again.
Comment #19
agentrickardI'm going to commit this.
Comment #20
agentrickardCommitted to 7.x.3 and 7.x.2
Comment #22
Gastonia commentedCould this still be an issue? As of drupal 7.19, I get different errors depending on where I place the memcache settings in relation to domain access settings file. For example
1) I get this error when I place memcache settings after domain settings at the end of the file:
"The form has become outdated. Copy any unsaved work in the form below and then reload this page."
This happens on all pages.
Also, regardless of what theme I have enabled under Appearance Bartik loads, and, even under appearance shows it as the default theme (when I remove it, everything goes back to the previous settings for the custom theme.)
2) When I place it immediately before domain settings, I get a WSOD. When I run drush cc all I get "Drush terminated to to an unrecoverable error." .. and no more info.
3) When I move memcache settings to the top of the settings.php file so that it loads before any other $conf array settings, the error goes away and the theme loads correctly.
In 3) it appears to be working, but I am wary. If it were truly working as it should, then why would it matter where the memcache settings are placed so long as they are before domain settings?
Memcache and domain are the only things I have added to the default settings.php file.
Comment #23
agentrickardBy default, the $conf array is instantiated when settings.php is loaded, and there are settings hardcoded in lines 505-507, so my assumption is that memcache settings should go before DA settings, but they shouldn't need to be at the very top.
What is the memcache code that you add?
Comment #24
Gastonia commentedMemcache code
The above was taken from the memcache instructions. I personally added the memcache_key_prefix to deal with a shared environment, but even if I delete that line the results are the same. Let me know what other info I can provide.
Comment #25
agentrickardTry not defining $conf as an array. I think you are destroying needed settings.
Use this syntax for each item:
If that works, it may be a bug in the memcache documentation.
Comment #26
Gastonia commentedGosh, I completely missed that I was reinstantiating the array. The new syntax works great, thanks for catching that. I'll add to the memcache issue queue for a doc update.