When I am doing various things in CiviCRM and want to save the changes, I keep getting logged out of the admin panel. As an example, but not the only scenario, I was trying to set up a custom profile for an event form. Set up the profile name and other data, hit save....went straight to the WP login screen! Anyone got any ideas? Most other functions working OK, but this is really annoying! Also happens when editing an event details, and select 'save and done' - 'save' works OK! HELP!

Using latest CIVICRM build 4.6.10 and Google Chrome on Windows 10.


Check that the URL configured for your WordPress site matches the URL in your CiviCRM civicrm.settings.php

If these have different URLs, you will appear to be logged out when you move "between sites". This sounds like it could match what you're describing.

The URLs must match for all of protocol (http vs HTTPS), domain (example.org vs example.com) and hostname (www.example.com vs example.com).


I was about to give up on this issue when I found the solution! When you install Wordpress one of the settings is the base URL for the site, and you can choose the URL format to include or exclude the 'www.' part. When I installed Wordpress, I decided to exclude the www from the base URL, but when I set up Civicrm I put the www in the base URL! I know there is some settings in the .htaccess that sorts all this out but it appears that if these settings are different, for some features of CiviCRM, there ends up with a 'redirect' path in the URL. Result - confusion and logout! If anyone else has this problem, don't just look at the settings for sub-domains/directories, look at the www settings as well! I changed my paths to be consistent, and no longer get logged out!!


File permission issue?

It seems that your web server user does not have permission to write to the temporary/file folder....

Your files should in general have 755 permissions for directories and 644 for files... The owner of the files should be the the web server process for this to work properly...

Quick fix to set directories to 755 and files to 644, assuming linux install ...

sudo find /yourwwwroot/wp-content/plugins/civicrm -type d -exec chmod 755 {} +

sudo find /yourwwwroot/wp-content/plugins/civicrm -type f -exec chmod 644 {} +

sudo find /yourwwwroot/wp-content/plugins/files/civicrm -type d -exec chmod 755 {} + sudo find /yourwwwroot/wp-content/plugins/files/civicrm -type f -exec chmod 644 {} +

Oh and also check the file owner... if you copied it, it might belong to you and not the web server so it's process can't write to it...

Hope this helps...


This is happening to me as well on my Civicrm installation under Wordpress. I think I have linked it to a path problem but I don't know how to fix it. I have wordpress in its own directory and am using a .htaccess file in the root and directory of the installation. Using Civicrm 4.6.10 with Wordpress 4.3.1.

  • I think it may be a path setup problem as well, but it seems strange that some functions that only require a READ of database data, work OK, but functions that require a WRITE to the database, such as editing a contact cause the logout problem. I would have thought that if it was a path problem both read and write functions would be affected? And anyway, why does it cause a logout instead of a page not found or something? Nov 20 '15 at 11:59
  • More information on my problem - server error message as follows: lighthousechristiancare.co.uk [Fri Nov 20 13:41:24 2015] [error] [client] AH01215: PHP Warning: Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/sites/lighthousechristiancare.co.uk/public_html) in Unknown on line 0: /home/sites/lighthousechristiancare.co.uk/public_html/crm/wp-admin/admin.php Nov 20 '15 at 13:46
  • Another server error message: lighthousechristiancare.co.uk [Fri Nov 20 13:41:24 2015] [error] [client] AH01215: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0: /home/sites/lighthousechristiancare.co.uk/public_html/crm/wp-admin/admin.php Do these messages mean anything to anyone?? Nov 20 '15 at 13:49
  • @RichardAdams the functions which write data make POST requests to the server, and those (which use HTML_QuickForm, anyway) submit to an absolute path as configured in civicrm.settings.php. When that is not matched to the URL you logged into, you land on a URL where you're not logged in. See my answer. Nov 22 '15 at 21:34
  • This problem is this!! When you have wordpress in its own directory, the url will be the domain/directory. The home will be the domain. I think cviicrm is using the home to find files and doesn't think you are logged in.
    – user21507
    Nov 23 '15 at 22:35

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.