I found that lot`s of people out there finding difficulty with the installation of CKEDITOR and CKFINDER.
Nobody taught me how to install it properly but I spent time with it and read all the manuals came with CKEDITOR and CKFINDER, that`s it everything goes well.
But I know that most of the people who installed these modules has got some errors or warnings like You don`t have access to brows the file or something similar warning messages.
I hope at least after this tutorial everybody will stop complaining about CKEDITOR and CKFINDER Installation.

OK I don`t wanna waste your time by talking so much... Let`s START...
Please follow the steps below;
(1) Go to http://drupal.org/project/ckeditor and download the module.
(2) Go to http://ckeditor.com/download and download CKeditor
(3) Go to http://ckfinder.com/download and download CKfinder
(4) Extract the CKeditor file downloaded from http://drupal.org/project/ckeditor then Double click and open the ckeditor file and you can see an another folder with same name ckeditor, double click and open it and then you can see a text file named COPY_HERE.txt
if you read that file you will find that why that folder is for. In this ckeditor folder you have to put the file you downloaded from http://ckeditor.com/download link.
So extract the file you dowloaded from Ckeditor.com and double click and open the file ckeditor and copy all the files in side the ckeditor and put it in the ckeditor folder which we dowloaded from drupal site.
(5) Now the file we downloaded from Drupal should look something like this ckeditor>ckeditor>ckeditor.php...
(6) Extract the dowloded file ckfinder and put it in Ckeditor folder. Now the pathe shoul look like this ckeditor>ckfinder
(7) Open ckeditor>ckfinder>config.php and remove the

CheckAuthentication() function:
        (don't worry, this function is defined in filemanager.config.php, see below)

        function CheckAuthentication()       <- remove it
        {                                    <- remove it
           //WARNING : DO NOT simply...      <- remove it
           ...                               <- remove it
           return false;                     <- remove it
        }                                    <- remove it

(8) ckeditor>ckfinder>config.php add the path to userfiles

$baseUrl = '/public_html/yoursitename.com/sites/all/modules/ckeditor/ckfinder/userfiles/'; (you can find this path from cpanel. Open the file ckeditor>ckfinder>userfiles and you can see the path to the userfiles on top left side of cpanel.)

(8) Add this code

require_once '../../../../includes/filemanager.config.php';

straight below the following line:

$baseDir = resolveUrl($baseUrl);
(9) Select CKFinder as preferred file browser in "Administer > Site configuration > CKEditor"
(in selected CKEditor profile scroll down to "File browser settings" section).
In the "File browser settings" section you may also change destination folders for files uploaded with CKFinder.

(10) Locate file named settings.php inside your drupal directory
drupal/sites/default/settings.php and on line 169 (# $cookie_domain = 'example.com';)
un-comment this line by removing # mark and change example.com to your domain name. Like this $cookie_domain = 'yourdomainname.com';

(Note: if you are on local computer add localhost $cookie_domain = 'localhost';).

(11) Open ckeditor>ckfinder>userfiles> and create three files named images, files and flash approximately.
(12) CKEditor Works only if you select Full HTML mode.

That`s it now put all these files in the sites>all>modules(note: you have to create this file.)

That`s it now go to administer and enable modules.
(note: Make sure that you have selected ckfinder as default file browser in ckeditor configuration. You can find this http://www.yoursitename.com/admin/settings/ckeditor here and then edit advanced user profile and set the ckfinder.

I hope I could help you. If anybody finds any difficulty to install or couldn`t understand what I explained here please contact me.
Checkout my site for more tutorials. How to install CKEditor and CKFinder!!!
Checkout my site for VIDEO tutorials. CKEditor and CKFinder Installation (Screen Cast) Video!!

I will be making a video tutorials about How to create your own custom CKEditor toolbar and plug-ins.

Comments

winandd’s picture

Number 10 is incomplete:
"..and set $cookie_domain variable to the"
the what? your domain I suppose?

I can't get it to work though.. :-(

I set it to $cookie_domain to 'localhost', no idea if this is a correct domain?

At number 11: Do you mean you have to create 3 empty FILES, or 3 FOLDERS?
Folders seems logical to me?

Should I be able to activatie the FCFinder module? Only module FCEditor shows up under installed modules..

At this state, FCEditor does not show the 'browse server' button..

omnius’s picture

well...

the site I'm working on at the moment it worked with the following:

if the site url is 'http://smurfs_are_the_best.com'

you put in 'smurfs_are_the_best.com'

Followed the instructions and works like a charm

knalstaaf’s picture

What if you use a local IP like: 192.168.168.16/mysite ?

Edit: Then you fill out the local IP. The problem was located somewhere else, and is solved now.

TheForumDude’s picture

I followed the instructions above (I think) and everything seems to be working perfectly, except that the preview image is broken. When I mean is that I can use the editor, and I can click the "Image" icon to invoke the image add/edit functionality, and once in CKEditor's "Image Properties" window I can click the "Browse Server" button, and then I am able to browse the image files on my server, and I am able to select an image. But after I select an image and return to the "Image Properties" windows, the "Preview" section shows a red square with a white 'X' inside to indicate that the image can't be previewed. At this point, if I inspect the text in the "URL" field, I see that CKFinder/CKEditor has inserted the following URL...

/sites/all/sites/default/files/images/content/myfile.jpg

...when the URL *SHOULD* be...

/sites/default/files/images/content/myfile.jpg

...so it's inserting an extra "/sites/all" at the beginning. Likewise, if I delete that extra "/sites/all" string, then the preview image appears, and then I can click OK, and the image is properly placed in the editor's content.

So there seems to be something going wrong somewhere between when the image is selected and when the selected images URL is handed from CKFinder to CKEditor. Please help me!!!

I should point out that my user files are not in the default location of /sites/all/modules/ckeditor/ckfinder/userfiles but instead are in the /sites/default/files/ directory. I hope this is not a problem. Please help!!!

habashko’s picture

I've got exactly the same problem, i did a workaround to solve this problem by hard-coding the path $ckfinder_user_files_path, $ckfinder_user_files_absolute_path in the file /ckeditor/includes/filemanager.config.php.

That's definitely not the right way to do it so we still need an answer. also i was wondering how to create folders to appear in ckfinder. in my case i need to create a private folder for each user that's only accessible by him/her. Please advice us

Tapa’s picture

The problem I mentioned before (I have included it below) has been solved. The thing is I had not set $cookie_domain = 'localhost'; in sites/default/settings.php

As soon as I did that, the ckfinder started working perfectly.

But remember to set the 'Input format' to 'Full HTML', otherwise the image will not appear in the content (node).

---------------------------------------------------------------------------------------------------------------------------

The problem I had mentioned (which has now been solved):
-----------------------------------------------------------

I am facing exactly the same problem. And besides, I also have to give upload permission not only to the authenticated user but also to anonymous users, otherwise I also receive the message.

The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.

Have you been able to come up with any solution?

---------------------------------------------------------------------------------------------------------------------------

bjsomers’s picture

I had the same problem with only gaining access to the finder until I read the documentation. It states:

Locate file named settings.php inside your drupal directory
(usually sites/default/settings.php) and set $cookie_domain variable to the
appropiate domain (remember to uncomment that line). If you don't do this,
CKFinder may show an information that the connector is disabled.
As of Drupal 6.17 also the $base_url variable must be set.

To uncomment the line, simply remove the hash (#) before it and enter your url as shown in the settings php file.

Now it works like a charm

anirvanroy’s picture

I have the same problem on my site. Except my problem is the following :

After I click on image button > Browse Server > double click pic > at this point the URL text box shows //imagesimages/PIC_0111.JPG, where it should actually be /imagesimages/PIC_0111.JPG (only one slash)

any solutions yet?

thanks

phprf’s picture

Go to your settings.php file and change the cookie domain detailed in step (10). That solved it for me, at least!

~Blessings, phprf

audster’s picture

I am having this exact same problem using Drupal 7..

Did you ever get an answer to this?

Ganganation’s picture

Did anyone get this solved? Same problem D7

BNI’s picture

Hello, and thank you for the tutorial. CkFinder works great when I allow anonymous users to upload but not when i allow authenticated, writers or editors. I recieve this error: The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.

What am I doing wrong or what I have not set? thank you for your help.

cerr’s picture

i did even enable it for anonymous but it still wouldn't let me: "The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file" - I also changed cookie_domain and base_url in the settings file... :( What else am I forgetting?

Thanks!

aerel’s picture

I had the same issue where if I changed the permissions to allow anonymous to upload files it worked. Otherwise it wouldn't.

EDIT: Also the preview function is broken.

dazzler’s picture

Hi,

Thanks for your work, but it is a bit incomplete. Here is the vid: http://jesox.com/posts/how-install-ckfinder-ckeditor-drupal

charlie-s’s picture

I am confused by #8:
require_once '../../../../includes/filemanager.config.php';

If you're in /sites/all/modules/ckeditor/ckfinder/config.php then ../../../../includes would be located in sites/includes/filemanager.config.php

I believe it should be simply ../includes/filemanager.config.php. Correct me if I'm wrong...

howartp’s picture

Charlie1234,

I believe the config.php file is actually called by a require_once() or include_once() command inside /sites/all/modules/ckeditor/ckfinder/core/connector/php/connector.php, thus when the filemanager line is called, it needs to navigate down from ckeditor/ckfinder/core/connector/php/ to ckeditor/includes, which would be correct.

Peter

charlie-s’s picture

Thank you for the explanation, Peter.

geronimo1949’s picture

Hi,
all works well but Im not able to use the AccessControl in file config.php of ckfinder:
Established ckeditor "roles" (i.e. Anonymous,Member,Redactor) but I'm not able to reutilise those roles in cKfinder to made it workable.
---> $config['RoleSessionVar'] = 'CKFinder_UserRole';<-----

I think that this variable must be filled with the ckeditor rolevariable but I dont know how.

Someone can help me.
Many thanks

jdlayn3’s picture

I am just starting out on Drupal and this was amazingly helpful. Thanks for the help. -Joe

lameei’s picture

+1

jheckman’s picture

I'm stuck here. If I follow instructions to put my site URL and delete the # symbol before that line so it's not commented out, then my site will no longer accept my login.

If I leave the #, my login works again, but CKFinder doesn't.

I can't upload files because there's a error message at the top of the site configuration page that says there is a problem with the configuration of one of my modules. I click through to the Status Report page and there is a message under CKEditor 3.3.1 that says:

You are using a feature that requires $cookie_domain to be set, but it
is not in your settings.php (CKFinder is enabled in the Advanced profile).

I assume it's saying that because the cookie domain I need to set is commented out. However, if I don't comment it out, I can no longer log in to the site.

Any suggestions?

anirvanroy’s picture

I have the exact same problem. Did you figure out how to solve this?

www.reformpartyindia.org

TheonH’s picture

I had the same problem and found that if you add "www." before "example.com", it works.

sukioki’s picture

never mind!

go to his website tutorial and skip all the confusion here.
works great, thanks!

cliffsw12’s picture

Hi, Just a note to say thanks - seems to work perfectly so far. Cliff

pandey5’s picture

Excellent article, i was struggling with this setup, and it is working fine now after following the steps.

valdimarS’s picture

these instructions are flawed, confusing and not correctly formatted.
at least if you post instructions make sure they are perfect.

martyn.mayfield’s picture

Great job - gave me confidence to go step by step and I got it! (with your help)

hubbi.fillah’s picture

I've followed all the instructions, but when want to upload pictures is always 'system error' and 'page not found' so I can not upload pictures, how do I fix this?

http://www.jeparamebel.co.id

drahman’s picture

THANK YOU! Thank you! Thank you!

I have been trying to install this all day. I was having trouble trying to piece together info from so many different places and then I found this post. This is exactly what I needed, a step by step with exact instructions that did not assume I knew anything. That is what newbies need.

One comment about the instructions. As one post noted some confusion for step 11, I think you are using the word "file" when you mean to say "folder" or "directory".

Again thanks so much!

oh one question: I assume I can change the base directory for the files to be any directory on the server I want? I mean, I have a pre-existing directory of images I want have access to from the ckfinder server browser.

drahman’s picture

In step 10 you write $cookie_domain = 'yourdomainname.com';. For me, this broke the login for drupal 6.19.

I believe the correct code should be $cookie_domain = '.yourdomainname.com';
Please note the period (.) before the domain.

I found the solution here: http://drupal.org/node/885664#comment-3589860

reptilo’s picture

hello drahman
i have the same problem when i put both "mysite.com" or ".mysite.com".
In the Readme.txt of CKEditor they wrote :
6. Locate file named settings.php inside your drupal directory
(usually sites/default/settings.php) and set $cookie_domain variable to the
appropiate domain (remember to uncomment that line). If you don't do this,
CKFinder may show an information that the connector is disabled.
As of Drupal 6.17 also the $base_url variable must be set.

So i put
$base_url = 'http://www.ebrsg.fr';
but still not working correctly.
Do you have an idea ?
thanks
Xavier

Sorry, i found it : just put $cookie_domain ='www.yoursite.com' and not 'yoursite.com'
It works now !

ssim’s picture

THIS WAS THE KEY it take me About 45min trying to figure it out.. lol... Thank you so much!!!

(10) Locate file named settings.php inside your drupal directory
drupal/sites/default/settings.php and on line 169 (# $cookie_domain = 'example.com';)
un-comment this line by removing # mark and change example.com to your domain name. Like this $cookie_domain = 'yourdomainname.com';

Thea

Feng-Shui’s picture

Champ! Thanks for this info!

xyen2001’s picture

First of all I'd like to thank you for your apprehensive guide. Following your guide, I installed and configured CKEditor and CKFinder successfully.
However, as I'm not a professional, and am very new to Drupal, I've spend more than 12 hours to make it.
Now I have a very confuse question. If I set in your step
(8) ...$baseUrl = '/public_html/yoursitename.com/sites/all/modules/ckeditor/ckfinder/userfiles/...
and setp (11) to add three folders in it,
why should we set
(9) ...In the "File browser settings" section you may also change destination folders for files uploaded with CKFinder..., that means "sites/default/files/"
Finally my image files were uploaded in "sites/default/files/images", not "/userfiles/images".
Second question, I could only see "images" and "basket" folders in CKFinder, but not other folders in "sites/default/files/images"?
Thank you again for your help.

pressduck’s picture

Worked for me in D7 without a glitch, and I'm a user only and have no clue of code whatsoever. I Installed the CKEditor in sites/all/libraries as instructed, but the CKFinder in sites/all/modules/CKEditor!!! I work on Mac and I couldn't change the settings.php permissions - so I downloaded the file, edited it (the cookie settings) and uploaded it again (replaced the old one, of course). Just in case, I made copies of all original files that needed to be edited. The following video is basicaly the same as these instructions, but if you prefer it over reading...

http://jesox.com/posts/how-install-ckfinder-ckeditor-drupal

Cheers, Ales

Wolf_22’s picture

The installation directions that ship with the ckfinder need to be improved. Period.

charlie-s’s picture

You're welcome to submit corrections / suggestions.

kipkoan’s picture

After installing CKFinder, I noticed that it was uploading files to the "private" directory (even though I have Drupal 7 set to use the "public" download method by default. How can I make CKFinder upload to the "public" directory, instead of the "private" directory?

Jean Gionet’s picture

I'm getting the same results with Drupal 7.
Any workaround?

thanks

A Day In The Life

Jean Gionet’s picture

getting the same thing!
what should the paths set in the ckeditor settings?

A Day In The Life

knalstaaf’s picture

Eventhough the settings look ok: http://i54.tinypic.com/u4rwm.png

Solutions?

knalstaaf’s picture

Resave the settings of the proper CKeditor profile with the correct file path in the CKfinder box.

Luciuz’s picture

hi everyone!

Now files upload into
'sites/default/files'
directory. How can i customize it to
'sites/default/files/[user-uid]/'

TY

oxide23’s picture

followed all the directions, and I can seemingly upload images, but after I click save or preview the images are not displayed.

Drupal version 6.2
ckfinder_php_2.0.2.tar.gz
ckeditor_3.5.3.tar.gz
ckeditor-6.x-1.3.tar.gz

I followed these directions:

How to install CKFinder
------------------------
CKFinder is an AJAX based file manager created by CKEditor developers: http://ckfinder.com/.

1. Download CKFinder for PHP: http://ckfinder.com/download
2. Unpack CKFinder to the directory with the CKEditor module (into sites/all/modules/ckeditor/c
kfinder)
The correct directory structure is as follows:

modules
ckeditor
ckeditor.module
ckeditor.admin.inc
...
ckfinder
core
ckfinder.php
config.php
...
ckeditor
_source
images
ckeditor.js
...

3. Grant "allow CKFinder file uploads" permission in "Administer > User Management > Permission
s"
Note: if you don't see such permission then it means that CKEditor didn't find CKFinder
and you have probably uploaded CKFinder into wrong directory.
4. Open CKFinder configuration file (sites/all/modules/ckeditor/ckfinder/config.php) and do the
following:

I) remove the CheckAuthentication() function:
(don't worry, this function is defined in filemanager.config.php, see below)

function CheckAuthentication() <- remove it
{ <- remove it
//WARNING : DO NOT simply... <- remove it
... <- remove it
return false; <- remove it
} <- remove it

II) add:

require_once '../../../../includes/filemanager.config.php';

straight below the following line:

$baseDir = resolveUrl($baseUrl);

5. Select CKFinder as preferred file browser in "Administer > Site configuration > CKEditor"
(in selected CKEditor profile scroll down to "File browser settings" section).
In the "File browser settings" section you may also change destination folders for files upl
oaded with CKFinder.

6. Locate file named settings.php inside your drupal directory
(usually sites/default/settings.php) and set $cookie_domain variable to the
appropiate domain (remember to uncomment that line). If you don't do this,
CKFinder may show an information that the connector is disabled.
As of Drupal 6.17 also the $base_url variable must be set.

npoku’s picture

For anyone still having problems, I noticed, I followed the instructions stated by CKFinder, Ciril Tharayil and oxide23 post. Nothing was still working. And then I realized my ftp upload/download log (in dreamweaver) said I had incomplete transfers to the server.

The problem was my GoDaddy Server was not allowing me to over write or change the permission status of the current sites/default/settings.php file. So I had to manually log into my GoDaddy Hosting account and use their ftp file manager to edit the settings.php file.

After that it worked like a charm!

Hope this helps.

nicodv’s picture

To those who didnt get a good result by this installation instructions, just (maybe is this your problem) check you are using the ckeditor in full html, otherwise it shows the picture but doesnt upload it...

PS: i dont get security or permission problems.

Cheers and thanks again

THE VERY LITTLE AGENCY

broken_halo1986’s picture

Took me a while to figure out file path problems, but once I did, it worked like a charm!

alternatecloud’s picture

broken_1986 what exactly did you figure out that helped you.

I am still stuck for WEEKS on the path issue.

any help would be appreciated

greg

hilarylouise’s picture

I spent the past few hours making all sorts of mistakes while installing cke... everything's up now and working great. This tutorial was incredibly helpful. Thank you.

firecentaur’s picture

If the images are only showing up in edit mode - make sure your "input format" is set to Full Html, and re-save - should appear then!

enrico200165’s picture

thanks for the useful posting but it seem absurd to have to do all this manual alchemy to set up an editor. Makes wordpress look attractive. Looking for another editor.

charlie-s’s picture

Just install ckeditor and use IMCE to handle file uploads. Won't take more than a few minutes.

CKFinder is complex, intelligent, and secure which is worth setting it up properly but can be annoying.

hmartens’s picture

Thank you csdco for your comment. I went your route and it's working beautifully and was so easy to setup!

Thanks again ;)

Living life in a grande way.

zeta1600’s picture

I keep forgetting that the settings.php file permission has to be changed before any changes can be made to it. Then, always a good idea to clear cache after changing settings.php.

Whew...

darthf1’s picture

If you install both CKEditor en CKFinder in the libraries folder (sites/all/libraries/ckeditor & sites/all/libraries/ckfinder), the required url path should be:

require_once '../../../../../modules/ckeditor/includes/filemanager.config.php';
audster’s picture

I was wondering about that path, because when you do install both in the sites/all/libraries folder I didn't find the filemanager.config.php in the instructions location and I hesitated proceeding until I knew more about it since it handles security (sorta kinda important there)

THANKS!

Nicolas Bouteille’s picture

I almost found the solution thanks to Peter "howartp" who explained above that :
"the config.php file is actually called by a require_once() or include_once() command inside /sites/all/modules/ckeditor/ckfinder/core/connector/php/connector.php, thus when the filemanager line is called, it needs to navigate down from ckeditor/ckfinder/core/connector/php/ to ckeditor/includes, which would be correct"

Installing both CKEditor and CKFinder in sites/all/libraries is the best practice I think since it prevents them from being erased when you do an automatic update of the CKEditor module from the Drupal 7 interface, which is the case when they are installed in sites/all/modules/ckeditor

In the CKEditor module README.txt it is written to add

- for CKFinder installed in the "sites/all/libraries/ckfinder" directory:
require_once '../../../includes/filemanager.config.php';

This should definitely be corrected !

Thanks again !

Nicolas

Anonymous’s picture

One more small addition to this part. If you run CKFinder inside of the CKEditor folder your require_once should look like this:

require_once '../../../../../../modules/ckeditor/includes/filemanager.config.php';

essentially adding one more directory. I'm not sure its the best practice to run CKFinder inside of the CKEditor folder, though I believe the instructions do say to do this. I could be wrong. At any rate. This is how a particular instance of mine is set up and this is how i got it to work.

DRIVE’s picture

Just to confirm that the require path change noted by ricardoom still works, particularly on the "CKeditor for Drupal" download from ckeditor.com which includes CKfinder inside of the /modules/ckeditor directory as noted.

I am using the "ckeditor for drupal" version with CKeditor 4.3.2 which does not have the "trial" stuff associated with it. PM me if you want the gzipped tarball. (today I noticed that the download from their site has the trial stuff, my version is the one just before that -- it still displays "unlicensed version" but there is no expire code within)

rolymiamidrupal’s picture

sorry i lost you on step 9 do i have to do this on the ckeditor file or the drupal account if is the drupal account how I'm going to be able to set this settings if i haven't installed the coeditor module?? can you please help me

argodeldrupal’s picture

Hi Folks,
I was struggling with this issue as well. I haven't seen anyone mention this so I thought I would share.
If you have set the file system to private, you must also tell CKeditor where the folder is and give it permission to access the files under global settings.

nitin_kumar’s picture

Thank you so much for this helpful post.

Badenser’s picture

Running it under Drupal 7, using the lates versions of the modules, 4.01 for the editor and 2.3.1 for CKFinder. At first it complained about the authentication set to True, which is what got me here, however following the steps described gets me a memory error, something like trying to allocate x amount of bytes and only having x amount, well I really have no idea where to increase this amount, other then in 'php.ini' and I am sure my provider wouldn't like me setting it even higher than it already is.
So I am at a loss other than setting the authentication back to true.
As someone else said, it's 2013 and we still don't have a build in editor.

nawhite82’s picture

After a few hours I was finally able to figure out how to get the CKFinder to work with CKEditor correctly with these instructions. Wow. I know it's not really designed for Drupal but what a process just to get CKFinder to work. I can tell Drupal will be a very fun and long project for me.

sboudetm’s picture

Thanks for your help..!

NewSites’s picture

The instructions here have a number of errors. I'd recommend people get the instructions from the original source, CKFinder Installation in the CKEditor for Drupal 7 Module (Open Source Version) on the CKFinder website. Much of the instructions above are taken almost verbatim from that, but with errors, such as leaving out the "dot" prefix in step 10.

DRIVE’s picture

See this article. I include info and download for using CKEditor 4.5.6 and CKFinder 2.3 -- those are the two latest versions I can find that will work on Drupal 7.x. Many of us won't be upgrading to Drupal 8.x until it is much more stable and has more modules ready for 8.x!!! ~enjoy :)

https://www.drupal.org/node/2836472

rajeev@blueappleonline.com’s picture

http://drupal.org/project/imce - much better and simpler