****SEE Edits below****
Edit added 1/4/2018 I started over again, following the instructions. As far as I can tell everything is correct including the synchronization plugin. fpw-sync-users.php in test.oursite.com 3 occurences of $other_prefixes = array( 'wp5l_', ); fpw-sync-users.php in forum.oursite.com 3 occurrences of $other_prefixes = array( 'wp7g_', ); Is that correct? What happens when I try to log in on either site is it just refreshes the login page and nothing happens. There are no error messages
****END EDIT****
My organization is using WordPress 4.9.1.
What we are hoping to accomplish is having members create a user profile on secure.oursite.org and when they login, they will have access to forums.oursite.org.
I have not been able to find updated instructions to complete this task. Can anyone here tell me what I need to do to accomplish this, or where to get the updated instructions?
Thank you
****ADDITIONAL Information***** I followed the instructions from @Frank P. at that link multiple times, and it is not working. I had to put everything back the way it originally was. Please see below for the steps I took and let me know if I did anything wrong.
The sites that I tried to test a Single Logon setup on are on subdomains: test.oursite.com and forum.oursite.com
test.oursite.com's database prefix is wp7g forum.oursite.com's datebase prefix is wp5l
I want test.oursite.com to be where the user is created.
I exported all the database tables from forum.oursite.com (except for wp5l_user and wp5l_usermeta) and imported them into the test.oursite.com datebase.
I went in to edit the wp-config.php files as instructed by Frank P. at this link Single sign on between two wordpress website He says both wp-config.php files must be identical, except for the prefixes at $table_prefix, which should show the original prefix of their database. Since I want the login to be created in test.oursite.com, I copied the entire wp-config.php file to forum.oursite.com's root.
I went in to edit forum.oursite.com's wp-config.php file and changed the $table_prefix to wp5l then saved it.
I went to edit wp-config.php for test.oursite.com and added the below defines and saved it.
define('COOKIE_DOMAIN', '.test.oursite.com'); //this is where I think the problem might be define('COOKIEPATH', '/'); define('COOKIEHASH', md5('test.oursite.com')); define('CUSTOM_USER_TABLE', 'wp7g_users'); define('CUSTOM_USER_META_TABLE', 'wp7g_usermeta');
I copied and pasted those same defines to wp-config.php in forum.oursite.com and saved it.
I created the mu-plugins folder in wp-content for both test.oursite.com and forum.oursite.org
7 I created fpw-sync-users.php in the mu-plugins folder for test.oursite.com and copied Frank P's code, then changed the 3 areas to my prefix and saved it as you see below.
$other_prefixes = array(
'wp7g_',
);
- I created fpw-sync-users.php in the mu-plugins folder for forums.oursite.com and copied the same code from the test.oursite.com mu-plugins folder so that the prefix is wp7g as Frank said it should be. I saved it.
That was apparently the last step. I went to test.oursite.com and logged in, then went to forum.oursite.com and saw that I was not logged in there. I went to wp-login.php and tried to login with the same credentials from test.oursite.com. It did not accept those credentials. I tried to log in with the original admin credentials and it would not accept those either. So I tried again to make these custom configurations work several more times, trying different things in case I misunderstood something. Nothing is working. I am hoping someone can look over the steps I have taken and tell me what I am missing.
Thank you.
******wp-config.php for test.oursite.com*****
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'oursite_test2');
/** MySQL database username */
define('DB_USER', 'oursite_test2');
/** MySQL database password */
define('DB_PASSWORD', 'hidden');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'hidden');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY',hidden');
define('SECURE_AUTH_KEY', 'hidden');
define('LOGGED_IN_KEY', 'hidden');
define('NONCE_KEY', 'hidden');
define('AUTH_SALT', 'hidden');
define('SECURE_AUTH_SALT', 'hidden');
define('LOGGED_IN_SALT', 'hidden');
define('NONCE_SALT', 'hidden');
define('COOKIE_DOMAIN', '.test.oursite.com');
define('COOKIEPATH', '/');
define('COOKIEHASH', md5('test.oursite.com'));
define('CUSTOM_USER_TABLE', 'wp7g_users');
define('CUSTOM_USER_META_TABLE', 'wp7g_usermeta');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp7g_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
****wp-config.php for forum.oursite.com*****
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'oursite_test2');
/** MySQL database username */
define('DB_USER', 'oursite_test2');
/** MySQL database password */
define('DB_PASSWORD', 'hidden');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'hidden');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY',hidden');
define('SECURE_AUTH_KEY', 'hidden');
define('LOGGED_IN_KEY', 'hidden');
define('NONCE_KEY', 'hidden');
define('AUTH_SALT', 'hidden');
define('SECURE_AUTH_SALT', 'hidden');
define('LOGGED_IN_SALT', 'hidden');
define('NONCE_SALT', 'hidden');
define('COOKIE_DOMAIN', '.test.oursite.com');
define('COOKIEPATH', '/');
define('COOKIEHASH', md5('test.oursite.com'));
define('CUSTOM_USER_TABLE', 'wp7g_users');
define('CUSTOM_USER_META_TABLE', 'wp7g_usermeta');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp5l_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
wp-config.php
for all three sites. Without seeing the code, I will not be able to help you.oursite.org
,secure.oursite.org
, andforums.oursite.org
. All three sites use one, common database, and your shared user tables should be these fromsecure.oursite.org
. Give me table prefixes of all three sites. Based on that I'll tell you how to edit wp-config.php files for all sites.