The original issue was:
Error: "You are using a feature that requires $cookie_domain to be set, but it is not set in your settings.php (CKFinder is enabled in the Advanced profile"
Any help would be highly appreciated.
What's the ticket is actually about: comment #18 by anarcat
From what I understand by reading this issue, it's because CKFinder bypasses the normal Drupal bootstrapping.
I do believe, however, that relying on a variable that *may* be defined in settings.php is a bug in that context. If you expect Drupal variables, you expect Drupal to be bootstrapped. If you bootstrap Drupal the wrong way, you're headed for a bunch of trouble, period.
The way the fix was proposed in Aegir was to add this line to the settings.php template:
$cookie_domain = $_SERVER['HTTP_HOST'];
I object to this change (edit: this change in aegir) on the ground that this work is already done by conf_init() (as found by Steven) in Drupal core itself.
If CKFinder doesn't bootstrap Drupal properly, it should at *least* default $cookie_domain properly, in the exact same way as above. It shouldn't be put on the users' shoulders to do that work instead of the module fixing its bootstrap code.
It could even be possible to load includes/common.inc and fire up conf_init()...
(I took the liberty of changing the issue title and type, I hope that's okay.)
Comment | File | Size | Author |
---|---|---|---|
#41 | ck finder - no browser button 2-18-13.jpg | 94.97 KB | bdavis113 |
Comments
Comment #1
mephir CreditAttribution: mephir commentedLook to sites/all/default/settings.php, line about 169:
uncomment this line and write there yourdomain with Drupal.
Comment #2
mephir CreditAttribution: mephir commentedIf you have any lack of clarity about issue, feel free to reopen it.
Comment #3
Barb CreditAttribution: Barb commentedI received the same message, and I don't know what to do given Response #2. I'm not sure how to get to "sites/all/default/settings.php, line about 169." I'm also not sure what "uncomment this line" means.
Comment #4
sp_key CreditAttribution: sp_key commentedHi mephir,
I haven't dealt with the issue yet.
One thing, could you please help me understand what it actually means and why it occurred now?
Anything wrong with my installation?
Comment #5
mephir CreditAttribution: mephir commented@Barb:
"uncomment" - remove # from start of the line,
$cookie_domain should have value with your domain where is Drupal installed f.e.:
You have drupal installation on domain yourdomain.com, so $cookie_domain should look like below:
If have installation on localhost, you should have something like that:
Comment #6
wwalc CreditAttribution: wwalc commentedit is required by CKFinder, perhaps you have enabled it.
Because CKFinder is launched "outside" Drupal engine, this setting is required to be able to bootstrap Drupal and access Drupal environment and sessions to check user permissions.
Comment #7
sp_key CreditAttribution: sp_key commentedCool, many thanks.
The error has been fixed for me
Comment #8
whiteley CreditAttribution: whiteley commentedI wonder if you could clarify this at all. We often use domain access for sites that have unrelated domain names and don't set the cookie_domain explicitly and it gets set in bootstrap.inc based on the site_name. I don't understand the explicit check for variable assignment in settings.php vs. variable existence.
Thanks!
Comment #9
focusmetacoaching CreditAttribution: focusmetacoaching commentedI get this message after I tried to change settings.php: The message comes when I try to go to the web-page
Fatal error: Call to undefined function check_markup() in /home/web78036/domains/focusmetacoaching.se/public_html/modules/node/node.module on line 1044
I don´t understand why the error message comes from a different place of the code.
tried to change things in settings.php, but nothing seems to change... what can I do?
txs
Comment #10
LarryZ CreditAttribution: LarryZ commentedI copied $cookie_domain = 'localhost'; to the following line with the $ in column 1.
I left my FCKeditor settings as is, File browser type: IMCE, and allow quick uploads.
After this change I receive, "Acess Denied".
I am using WAMP with Win XP Pro.
This is a recent problem. I think it started after I updated some modules. It was working before.
Comment #12
ClearXS CreditAttribution: ClearXS commentedVery nice; I tried both solutions.
The result was that I got logged out of my admin account for the page I was on. Trying to get a new password to my email resulted in errors (maybe due to many email subscription aso modules I installed yesterday).
I´m not sure if this solution is possible with booster and some other settings?
(I disabled the rule in settings.php and had another screen in my memory and could use it again for new admin screens)
Comment #13
ClearXS CreditAttribution: ClearXS commentedsetting the version to the latest dev 1 series, as I´m using that one
Comment #14
wwalc CreditAttribution: wwalc commented@ClearXSClearXS - setting $cookie_domain may cause that you will be logged out (happened to me many times, but this happens just once, straight after setting it). If you enter the correct password again, you should be able to log in back.
Comment #15
jday CreditAttribution: jday commentedinterested in any response to #8 whiteley concerning the use of both domain access and ckeditor, for now I just leave the cookie domain unset
Comment #16
oakamit CreditAttribution: oakamit commentedWhen i tried to edit settings.php & saved it there was error[a fatal error or timeout occurred while processing this directive] as above-
open settings.php failed: Permission denied at cpanel line 4988
Carp::croak('open settings.php failed: Permission denied') called at /usr/local/cpanel/Cpanel/Fileman.pm line 1106
Cpanel::Fileman::fmsavefile('%2fhome%2fkonk5728%2fpublic_html%2fsites%2fdefault', 'settings.php', '<?php^M^J// $Id: default.settings.php,v 1.8.2.4 2009/09/14 12:59:1...', '', 1) called at cpanel line 4988
main::__ANON__('%2fhome%2fkonk5728%2fpublic_html%2fsites%2fdefault', 'settings.php', '<?php^M^J// $Id: default.settings.php,v 1.8.2.4 2009/09/14 12:59:1...', '', 1) called at cpanel line 1093
eval {...} called at cpanel line 1093
main::real_exectag(' main::dotag_finished_headers(' main::cpanel_parseblock(' main::cpanel_parse('GLOB(0xac48ed4)') called at cpanel line 5335
main::run_standard_mode() called at cpanel line 387
Comment #17
Steven Jones CreditAttribution: Steven Jones commentedApologies for re-opening, but trying to keep some context.
I'm coming from #994196: Add $cookie_domain directly in the settings.php template, since it will not work if defined in the included file..
CKEditor is complaining if the $cookie_domain variable is not set explicitly in settings.php but it seems that it never uses the $cookie_domain variable. I see a call to drupal_boostrap, which will invoke conf_init() which will then set the $cookie_domain if not already set (in filemanager.config.php).
So, my question is, is this check needed? If I don't set the cookie domain, does CKEditor still work?
If $cookie_domain is needed in the settings.php, do you know why? It appears that it shouldn't be.
Comment #18
anarcat CreditAttribution: anarcat commentedFrom what I understand by reading this issue, it's because CKFinder bypasses the normal Drupal bootstrapping.
I do believe, however, that relying on a variable that *may* be defined in settings.php is a bug in that context. If you expect Drupal variables, you expect Drupal to be bootstrapped. If you bootstrap Drupal the wrong way, you're headed for a bunch of trouble, period.
The way the fix was proposed in Aegir was to add this line to the settings.php template:
I object to this change (edit: this change in aegir) on the ground that this work is already done by conf_init() (as found by Steven) in Drupal core itself.
If CKFinder doesn't bootstrap Drupal properly, it should at *least* default $cookie_domain properly, in the exact same way as above. It shouldn't be put on the users' shoulders to do that work instead of the module fixing its bootstrap code.
It could even be possible to load includes/common.inc and fire up conf_init()...
(I took the liberty of changing the issue title and type, I hope that's okay.)
Comment #19
wwalc CreditAttribution: wwalc commentedSounds interesting, also considering that enabling CKFinder is a nightmare for beginners at this moment, to check.
Comment #20
rex_the_first CreditAttribution: rex_the_first commentedJust a quick warning. I tried setting
$cookie_domain = $_SERVER['HTTP_HOST'];
and
$cookie_domain = www.mydrupalinstall.com
to sort out the CKEditor problem but both of these made logging in impossible. No Drupal user could log into the site (not even admin) and it was this thread that pointed me to cookie domain.
Any other solutions to this error message?
Comment #21
suganyaM CreditAttribution: suganyaM commentedHi,
If you have installed in your localhost,
$cookie_domain = 'localhost';
Or
$cookie_domain = '.mydrupalinstall.com'; //See the dot(.) before the domain name
Hope this might help you!!!!!!!
Comment #22
hschott CreditAttribution: hschott commentedI'm having this same problem. If you set $cookie_domain then you can't log in. Has anyone found a solution?
Comment #23
rex_the_first CreditAttribution: rex_the_first commented@ suganyaM
Thanks, the dot before the domain name sorted it, thanks.
Comment #24
hschott CreditAttribution: hschott commentedI tried this and still get access denied. But even worse, when I put the old file back, I can log in, but get access denied on everything I try to do. This is so frustrating!
Comment #25
ryan.gibson CreditAttribution: ryan.gibson commentedWorked for me.
Comment #26
developerweeks CreditAttribution: developerweeks commentedI am having issues with ckfinder as well. I thought it might be my cookie setting also, but I find that my aegir server has cleverly added this code with comments:
/**
* We try to set the correct cookie domain. If you are experiencing problems
* try commenting out the code below or specifying the cookie domain by hand.
*/
if (isset($_SERVER['HTTP_HOST'])) {
$domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
// Per RFC 2109, cookie domains must contain at least one dot other than the
// first. For hosts such as 'localhost', we don't set a cookie domain.
if (count(explode('.', $domain)) > 2) {
@ini_set('session.cookie_domain', $domain);
}
}
Perhaps that will help others.
And as this seems to match all the instructions I have found, I am guessing my 403 denied error is caused elsewhere.
I have set my site's files/ folder with chmod 777
I have set the ckfinder's config.php to $baseUrl = '/files/';
Filesystem is public
I am getting:
It was not possible to properly load the XML response from the web server.
Raw response from the server:
403 Forbidden
nginx/1.0.5
I am out of ideas.
Comment #27
mkesicki CreditAttribution: mkesicki commented@developerweeks if I understood you correctly , this code is added to all your request ?
If yes, this code will be on top of output of CKFinder's XML response and this is the reason why it can't load response.
Comment #28
lunk rat CreditAttribution: lunk rat commentedI added a local.settings.php file with the cookie domain line and it works. CkFinder still reports an error in Status Report, which makes my client freak out because they see "One or more problems detected with your Drupal installation" ... but CkFinder works.
Comment #29
Alan Warren CreditAttribution: Alan Warren commentedThe problem continues, Nov 2012. Exactly the same error message as Feb 2010. To me tells me all I need to know about customer support. Guess who won't be purchasing CKFinder.
Comment #30
dkingofpa CreditAttribution: dkingofpa commented@lunk_rat I did the same thing with a local.settings.php file and $cookie_domain. Everything works, but the Status Report page still says I don't have the module properly configured. After seeing that someone else had the same problem, I've concluded this is a module bug and not my error.
Comment #31
dczepierga CreditAttribution: dczepierga commented@dkingofpa, try to use last DEV version - i fix there all problem with paths in CKEditor module, so this should be also fixed.
Greetings
Comment #32
bdavis113 CreditAttribution: bdavis113 commentedI am putting in my domain name with the . before it,
This is what I am putting in:
$cookie_domain = '.http://anchorchristianchurch.org';
and I am getting the following message when I go to save:
Could not open /home/anchorch/public_html/sites/default/settings.php for writing: Permission denied
Comment #33
wwalc CreditAttribution: wwalc commented1. Do not include "http://" in $cookie_domain
2. settings.php is set to readonly by Drupal itself, try chmodding to 666, see this article
Comment #34
wwalc CreditAttribution: wwalc commentedComment #35
bdavis113 CreditAttribution: bdavis113 commentedthank you that got that part to work.
after that I still do not get the ability to browser server to upload images, when I click on the image icon to put an image on a page? any idea what I might have done incorrectly?
As you can tell I am very new to code, but I am picking it up pretty quickly.
I have put the settings to 777.
Thank you.
Comment #36
wwalc CreditAttribution: wwalc commentedMake sure to follow the README, e.g. :
Comment #37
bdavis113 CreditAttribution: bdavis113 commentedI am unable to find the readme file in my ckfinder files anywhere, I have been looking for 3 days to find it. I do not see ckfinder as stated in #3 above. I already had #6 set as stated.
Comment #38
mkesicki CreditAttribution: mkesicki commented@bdavis113,
please follow: http://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7/CKFinder
Comment #39
pirash CreditAttribution: pirash commentedThe following line will do the magic, even if you have a multi-site setup using domain access module. This will take care of the domain switch and resolves the CKFinder issue. :)
Comment #40
pirash CreditAttribution: pirash commentedThe following line will do the magic, even if you have a multi-site setup using domain access module. This will take care of the domain switch and resolves the CKFinder issue. :)
$cookie_domain = $_SERVER['SERVER_NAME'];
Comment #41
bdavis113 CreditAttribution: bdavis113 commentedok, I redid that, now I am getting a file browser disabled for security reasons. but I think I noticed that somewhere else in the feed above, so I will look for that. thank you for your patience and guidance. this has been a huge help and learning experience for me. it is much appreciated. thank you all.
Comment #42
net55 CreditAttribution: net55 commentedckeditor fix that worked for me, thx all.
had to set the permissions for (sites/default/settings.php) settings.php to 666 in a ftp program
For some reason my host resets the permissions every hour or so for this file...this threw me off for a while!
$cookie_domain = '.mydomainname.com';
uncomment it (removed the # in front of: # $cookie_domain = 'example.com';)
Comment #42.0
net55 CreditAttribution: net55 commentedupdated issue description to match the real problem to be solved
Comment #43
R-H CreditAttribution: R-H commentedI'm on a hosted Aegir platform from Omega8. The cookie_domain setting is in the global.inc file. Can CKEditor take the cookie_domain setting from there?
Comment #44
R-H CreditAttribution: R-H commentedI've also tried to place the cookie_domain setting in the local.settings.php file and it doesn't work. Can't browse my files but can upload a file. Get the error message on the status page.