1

I've just upgrade a site, which as far as I'm aware was working fine, from CiviCRM 4.6.x to 4.7.8. Only now the file/image browser and file upload facility within the CKEditor (which I understand is provided by KCFinder, is displaying nothing in the file/image browser and won't let me upload anything. Don't know if this is a bug in the 4.7.8 release for Wordpress. I've never come across this issue before in CiviCRM, on dozens of different sites. I've read that KCFinder is fussy about paths and permissions. Any pointers about how to fix this very welcome.

Update: from the error log I see that each time I open up the KCFinder browse window I get a pattern of notices and warnings, ending with a fatal error:

PHP Notice: Undefined variable: output in /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 403, referer: http://account.co.uk/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fadd&reset=1&action=add

PHP Warning: exec() has been disabled for security reasons in /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 403, referer: http://account.co.uk/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fadd&reset=1&action=add

PHP Notice: Undefined variable: output in /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 404, referer: http://account.co.uk/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fadd&reset=1&action=add

PHP Warning: implode(): Invalid arguments passed in /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 404, referer: http://account.co.uk/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fadd&reset=1&action=add

PHP Fatal error: Uncaught exception 'Exception' with message 'Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure.' in /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php:125\nStack trace:\n#0 /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php(413): Civi\Cv\Bootstrap->boot()\n#1 /home/account/sites/default/wp-content/plugins/civicrm/civicrm/packages/kcfinder/integration/civicrm.php(45): require_once('/home/account/si...')\n#2 /home/account/sites/default/wp-content/plugins/civicrm/civicrm/packages/kcfinder/integration/civicrm.php(140): checkAuthentication()\n#3 /home/account/sites/default/wp-content/plugins/civicrm/civicrm/packages/kcfinder/core/bootstrap.php(39): require('/home/account/si...')\n#4 /home/account/sites/default/wp-content/plugins/civicrm/civicrm/packages/kcfinder/browse.php(15): require('/home/account/si...')\n#5 {main}\n thrown in /home/account/sites/default/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 125, referer: http://account.co.uk/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fadd&reset=1&action=add

I've got 4.6.x sites running on the exact same server set-up with no issues. This is the first site with 4.7.x on this server.

  • I would start looking at the Image Upload URL under Resource URLs, navigating to Administer-System Settings-Resource URLs, in 4.7.X it should look like [civicrm.files]/persist/contribute, check permissions of the folder, also test with the absolute path ie https://domain.com/wp-content/plugins/files/persist/contribute – Andrei Jun 7 '16 at 19:27
1

There used to be a requirement that the URLs that Andrei referred to above could not contain symbolic links. I don't know if that is still the case, but make sure that all directories in that path are true directories and not symbolic links.

  • I believe it's the code to handle symbolic links that's causing the issue Graham is seeing. Unfortunate! – Jon G - Megaphone Tech Jun 11 '16 at 19:37
1

I don't think there's an intentional change in system requirements. However, looking at civicrm.config.php, I can see it's undergone recent changes. It looks like you're having trouble because your PHP configuration doesn't allow running the "exec" command. That's often done for security - but if you can change your configuration to allow it, I think you'll be better off.

If not, maybe change line 401 in civicrm.config.php to read:

if (true) {

to force it to use the alternate method of finding your search directory?

Please try either changing that line or your PHP configuration to allow "exec" and let us know if it solved the problem for you!

  • Many thanks @jon-g. I'll give that advice a spin and will report back in this thread. – Graham Jun 15 '16 at 9:19
  • @Graham Any work on whether this worked out for you? I'm about to close the ticket on Jira. – Jon G - Megaphone Tech Dec 21 '16 at 15:34
  • Well the issue was resolved, but for the life of me I can't recall what I did to correct things, which is annoying as I forgot to write it down here. Apologies. – Graham Dec 21 '16 at 15:43
  • 1
    I actually looked this over a bit more - I'm pretty sure my original statement is correct, based on the errors you're seeing. I think I found a way to rewrite the code to a) not use "exec" and b) still work when Civi is symlinked. I'll report back on the ticket. – Jon G - Megaphone Tech Dec 21 '16 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.