****请参见下面的编辑****
Edit added 1/4/2018 我按照指示重新开始。就我所知,一切都是正确的,包括同步插件。fpw同步用户。测试中的php。我们的网站。com 3出现$other\\u前缀=数组(\'wp5l\\u\',);fpw同步用户。论坛中的php。我们的网站。com 3$other\\u前缀的出现次数=数组(\'wp7g\\u\',);对吗?当我尝试登录任何一个站点时,会发生什么情况?它只是刷新登录页面,什么也没有发生。没有错误消息
****结束编辑****
我的组织正在使用WordPress 4.9.1。
我们希望实现的是让成员在secure上创建用户配置文件。我们的网站。org,当他们登录时,他们将有权访问论坛。我们的网站。组织。
我无法找到完成此任务的更新说明。这里有谁能告诉我需要做些什么来完成这项工作,或者从哪里获得最新的说明?
非常感谢。
****其他信息****我多次按照@Frank P.的指示在该链接上进行操作,但它不起作用。我不得不把一切都恢复到原来的样子。请看下面我采取的步骤,如果我做错了什么,请告诉我。
我尝试在其上测试单个登录设置的站点位于子域上:test。我们的网站。com和论坛。我们的网站。com公司
测验我们的网站。com的数据库前缀是wp7gforum。我们的网站。com的数据库前缀为wp5l
我想要测试。我们的网站。com是创建用户的位置。
我从论坛导出了所有数据库表。我们的网站。com(wp5l\\u user和wp5l\\u usermeta除外)并将它们导入测试。我们的网站。com数据库。
我进去编辑wp配置。按照Frank P.的指示,在这个链接上创建php文件Single sign on between two wordpress website他说两个wp配置。php文件必须相同,除了$table\\u prefix处的前缀,该前缀应显示其数据库的原始前缀。因为我想在测试中创建登录名。我们的网站。com,我复制了整个wp配置。php文件到论坛。我们的网站。com的根目录。
我去编辑论坛了。我们的网站。com的wp配置。php文件,并将$table\\u前缀更改为wp5l,然后将其保存。
我去编辑wp配置。php用于测试。我们的网站。com并添加了以下定义和保存。
定义(\'COOKIE_DOMAIN\',\'test.oursite.com\')//这就是我认为问题可能在于定义(\'COOKIEPATH\',\'/\');define(\'COOKIEHASH\',md5(\'test.oursite.com\');定义(\'CUSTOM\\u USER\\u TABLE\',\'wp7g\\u users\');定义(\'CUSTOM\\u USER\\u META\\u TABLE\',\'wp7g\\u usermeta\');
我将这些相同的定义复制并粘贴到wp config。论坛中的php。我们的网站。com并将其保存。
我在wp内容中为这两个测试创建了mu插件文件夹。我们的网站。com和论坛。我们的网站。组织机构
我创建了fpw同步用户。用于测试的mu plugins文件夹中的php。我们的网站。com并复制了Frank P的代码,然后将3个区域更改为“我的前缀”,并将其保存为如下所示。
$other_prefixes = array(
\'wp7g_\',
);
我创建了fpw同步用户。论坛的mu plugins文件夹中的php。我们的网站。com并从测试中复制了相同的代码。我们的网站。com mu plugins文件夹,因此前缀是wp7g,正如Frank所说的那样。我保存了它这显然是最后一步。我去考试了。我们的网站。com并登录,然后转到论坛。我们的网站。com并看到我没有在那里登录。我去了wp登录。php并尝试使用测试中相同的凭据登录。我们的网站。com。它不接受这些凭据。我尝试使用原始管理员凭据登录,但它也不会接受这些凭据。所以我又尝试了几次让这些自定义配置工作,尝试了不同的方法以防我误解了什么。什么都没用。我希望有人能看看我采取的步骤,告诉我我错过了什么。
非常感谢。
******wp配置。php用于测试。我们的网站。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\');