Prologue#
PHP8+ is required for both WordPress and the current version of Discuz! on the server. An upgrade is needed.
Official#
Discuz Wiki and forum post.
Corrections#
Taking the Discuz! directory on the server as the root directory "/":
- First, disable the site in the backend management/uc_server/admin.php.
- UC communication is considered normal when both sides, Discuz <-> UC, are functioning properly. Both sides need to confirm.
- Regarding
UC_KEY
: /uc_server/data/config.inc.php and /config/config_ucenter.php can be different. Use the existing one and do not change it to be the same as the official guide requires, otherwise Discuz -> UC will fail. - Regarding
UC_DBTABLEPRE
: /uc_server/data/config.inc.php and /config/config_ucenter.php are different. The config of Discuz! should include the prefix ofdbName
. - Most issues during the upgrade process come from these two configuration files being incorrect.
- If the site is not disabled, the Discuz upgrade will get stuck after the envcheck step. Refresh once to resolve.
- After the upgrade, the original founder can log in to the forum but cannot access the admin backend. If it is a user group issue, you can directly modify the database with
update [table]common_member set groupid=1 where uid=%d;
. - After the upgrade, remember to update the cache, otherwise the style will be lost.
- After the upgrade, users cannot update their avatars, which is also a UC communication issue.
- Discuz! is not fully compatible with PHP8, especially the
$_G['settings']['bannedmessages']
attribute. This attribute uses string concatenation when generated in admincp, but uses bitwise operations when validating related flags. This causes an error of Uncaught TypeError: Unsupported operand types: string & int when using statements like$_G['settings']['bannedmessages'] & 1
. To fix this, change the relevant statements tointval($_G['settings']['bannedmessages']) & 1
.