Answers.Body: <p>I forgot to post an answer before, but am prompted to do so as someone has a similar problem.</p>
  
  <p>I needed to set directory 755 and files 644 for wp-content/plugins/civicrm/civicrm/packages/kcfinder because the WP distribution didn't set permissions that worked in my hosting environment.</p>
  
  <p>But since CiviCRM 5.2.2 this wasn't necessary.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-02T19:54:20.230Z
Answers.Text: Thanks. I just tried this (set directory 755) for /civicrm/packages/kcfinder in Drupal 7 / CiviCRM 5.57.0 and it appears to have done the job after I deleted the session cookie in my browser and then logged in again.
Answers.UserDisplayName: Andrew Wasson
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-19T21:59:00.243Z
Answers.LastActivityDate: 2019-04-19T21:59:00.243Z
Answers.UserDisplayName: Mick Kahn
Body: <p>I can't browse images to include in CKEditor when using CiviMail. When I click the browse button in the image window, the following pops up</p>
  
  <p>[....]/civicrm/civicrm/packages/kcfinder/browse.php?cms=civicrm&amp;type=images&amp;CKEditor=crmUiId_1&amp;CKEditorFuncNum=0&amp;langCode=en</p>
  
  <p>and get "500 - Internal Server Error" with suggestions that file permissions are not correct. Don't know what to check specifically, but all the resource URLS and directories are defaults and file permissions look generally OK.</p>
  
  <p>I have WordPress 4.8.2 and CiviCRM 4.7.25. There are one or two similar posts about not being able to browse files, but none quite the same and answers not very specific about what what files to check permissions of. Nothing in the ConfigAndLog directory. Works fine on the demo WordPress site, but of course can't see permissions etc. I'm stuck!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-27T09:26:45.973Z
Comments.Text: Have you tried uploading an image through CKEditor in CiviMail?
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-27T16:25:50.077Z
Comments.Text: I have tried an upload and when I press "send it to the server" it goes to a screen still with the "send it to the server button" and an odd scroll bar across the top. Otherwise no meaningful content. If I press "OK" then I get a message "Image source URL is missing". No doubt related.
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-27T16:30:31.280Z
Comments.Text: Also, I can't try it out on my test site because of another problem that means I don't see CKEditor at all there. See https://civicrm.stackexchange.com/questions/20888/wysiwyg-editor-not-present-with-wordpress. That means I can't mess around with Resource URL or directory settings as that might break something else on the live site.
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T08:33:48.233Z
Comments.Text: I've now found some logs with more details and get "[2017-11-03 08:17:41]: error: directory is writable by others: (/home/downham4/public_html/wp-content/plugins/civicrm/civicrm/packages/kcfinder)" but any attempts to reduce the permissions for the directory either have no effect or result in a 403 error which is permissions to low!
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T15:34:42.837Z
Comments.Text: maybe its about ownership rather then permissions? (don;t know, just exploring)
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T16:47:13.107Z
Comments.Text: @Graham I've made some progress and I can at least get images in. It may have been that during my last test I didn't save the permission changes properly. Now I have found that if I change the directory ...packages/kcfinder to 755 and the files  in packages/kcfinder to 644 that the upload works and the browse partially works. On the browser window I don't see any files, but various options and the links are of the form kcact:refresh etc which my browser doesn't recognise. I have also activated ImageMagick (I think) which the kcfinder readme files says is needed, but that makes no difference.
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-27T17:04:07.613Z
Comments.Text: Changing more permissions for kcfinder makes more work, but there are a lot and I haven't quite got there yet... hopefully will be sorted soon.
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T08:38:10.333Z
Comments.Text: I can't help feeling that there is something amiss with your hosting environment. As far as I can recall I've never had problems with this stuff in many installs on many different servers. It just works.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T09:15:24.443Z
Comments.Text: I'm following this up with my hosting provider, SiteGround, but I've found something on their site relating to the 500 errors: "We do not allow higher than 755 permissions due to the fact that our Apache web server runs the PHP interpreter as a CGI in SuExec mode and such permissions are considered a security risk." which I think may be a generic thing for shared hosting. I've opened a separate question on this as its much broader than CKEditor. See https://civicrm.stackexchange.com/questions/21540/file-permissions-with-hosted-wordpress .
Comments.UserDisplayName: Mick Kahn
Tags: <wordpress><ckeditor><images>
Title: Adding images in CKEditor
ThreadText: # Adding images in CKEditor
  
  (Asked by: username_0 on 2017-10-24)
  
  I can't browse images to include in CKEditor when using CiviMail. When I click the browse button in the image window, the following pops up
  
  [....]/civicrm/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=crmUiId\_1&CKEditorFuncNum=0&langCode=en
  
  and get "500 - Internal Server Error" with suggestions that file permissions are not correct. Don't know what to check specifically, but all the resource URLS and directories are defaults and file permissions look generally OK.
  
  I have WordPress 4.8.2 and CiviCRM 4.7.25. There are one or two similar posts about not being able to browse files, but none quite the same and answers not very specific about what what files to check permissions of. Nothing in the ConfigAndLog directory. Works fine on the demo WordPress site, but of course can't see permissions etc. I'm stuck!
  
  **Tags:** wordpress, ckeditor, images
  
  > **Comments:**
  > **username_1**: Have you tried uploading an image through CKEditor in CiviMail?  
  > **username_0**: I have tried an upload and when I press "send it to the server" it goes to a screen still with the "send it to the server button" and an odd scroll bar across the top. Otherwise no meaningful content. If I press "OK" then I get a message "Image source URL is missing". No doubt related.  
  > **username_0**: Also, I can't try it out on my test site because of another problem that means I don't see CKEditor at all there. See https://civicrm.stackexchange.com/questions/20888/wysiwyg-editor-not-present-with-wordpress. That means I can't mess around with Resource URL or directory settings as that might break something else on the live site.  
  > **username_0**: I've now found some logs with more details and get "[2017-11-03 08:17:41]: error: directory is writable by others: (/home/downham4/public_html/wp-content/plugins/civicrm/civicrm/packages/kcfinder)" but any attempts to reduce the permissions for the directory either have no effect or result in a 403 error which is permissions to low!  
  > **username_1**: maybe its about ownership rather then permissions? (don;t know, just exploring)  
  > **username_0**: @username_1 I've made some progress and I can at least get images in. It may have been that during my last test I didn't save the permission changes properly. Now I have found that if I change the directory ...packages/kcfinder to 755 and the files  in packages/kcfinder to 644 that the upload works and the browse partially works. On the browser window I don't see any files, but various options and the links are of the form kcact:refresh etc which my browser doesn't recognise. I have also activated ImageMagick (I think) which the kcfinder readme files says is needed, but that makes no difference.  
  > **username_0**: Changing more permissions for kcfinder makes more work, but there are a lot and I haven't quite got there yet... hopefully will be sorted soon.  
  > **username_1**: I can't help feeling that there is something amiss with your hosting environment. As far as I can recall I've never had problems with this stuff in many installs on many different servers. It just works.  
  > **username_0**: I'm following this up with my hosting provider, SiteGround, but I've found something on their site relating to the 500 errors: "We do not allow higher than 755 permissions due to the fact that our Apache web server runs the PHP interpreter as a CGI in SuExec mode and such permissions are considered a security risk." which I think may be a generic thing for shared hosting. I've opened a separate question on this as its much broader than CKEditor. See https://civicrm.stackexchange.com/questions/21540/file-permissions-with-hosted-wordpress .  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-04-19. Score: 3 | Accepted answer
  
  I forgot to post an answer before, but am prompted to do so as someone has a similar problem.
  
  I needed to set directory 755 and files 644 for wp-content/plugins/civicrm/civicrm/packages/kcfinder because the WP distribution didn't set permissions that worked in my hosting environment.
  
  But since CiviCRM 5.2.2 this wasn't necessary.
  
  > **Comments:**
  > **username_2**: Thanks. I just tried this (set directory 755) for /civicrm/packages/kcfinder in Drupal 7 / CiviCRM 5.57.0 and it appears to have done the job after I deleted the session cookie in my browser and then logged in again.  
  
  ---
  
  