You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

手动安装于cPanel服务器的RoundCube密码插件无法使用求助

Fixing RoundCube Password Plugin Socket Error on cPanel

Alright, let's break down why you're hitting that Could not save new password. Can't create socket connection to tcp://localhost:2222 error with RoundCube's Password plugin. That localhost:2222 address is supposed to connect to cPanel's backend API port, which the plugin uses to update user passwords. Here's how to troubleshoot and fix this step by step:

1. Verify Local Port Connectivity First

First, confirm if your server even allows connections to port 2222 from the local system. Log into your server via SSH and run one of these commands:

telnet localhost 2222
# Or use nc if telnet isn't installed
nc -zv localhost 2222

If you get a "connection refused" or timeout, the problem isn't with RoundCube—it's with your server blocking access to that port. Skip to steps 2 and 3 to fix firewall/SELinux issues.

2. Check Firewall Rules

Most cPanel servers use CSF (ConfigServer Security & Firewall) or firewalld. You need to ensure local connections to port 2222 are allowed:

  • For CSF: Open /etc/csf/csf.conf and look for the ALLOWLOCAL line. Make sure 2222 is included in the list of allowed ports. Then restart CSF with csf -r.
  • For firewalld: Run firewall-cmd --add-port=2222/tcp --zone=trusted --permanent followed by firewall-cmd --reload to allow local traffic to the port.

3. Disable SELinux Temporarily (Test Only)

SELinux can block web server processes (like Apache/Nginx, which runs RoundCube) from connecting to non-standard ports. To test if this is the issue:

setenforce 0

Now try changing your password in RoundCube again. If it works, you'll need to permanently allow web server network connections:

setsebool -P httpd_can_network_connect on

4. Fix RoundCube Password Plugin Configuration

This is where most people trip up. Open your RoundCube Password plugin config file (usually at roundcube/plugins/password/config.inc.php) and adjust these settings:

// Set the driver to cPanel
$config['password_driver'] = 'cpanel';

// Use localhost for local connections (most reliable)
$config['password_cpanel_host'] = 'localhost';

// Critical: Match the port to your protocol
// Use 2087 for SSL, 2086 for non-SSL (not 2222!)
$config['password_cpanel_port'] = 2087;

// Enable SSL if using port 2087
$config['password_cpanel_ssl'] = true;

// Use the logged-in user's credentials to authenticate with cPanel API
$config['password_cpanel_username'] = '%u';
$config['password_cpanel_password'] = '%p';

// Optional: Use UAPI (recommended for newer cPanel versions)
$config['password_cpanel_use_uapi'] = true;

Note: If you tried switching to ssl:// earlier but kept port 2222, that's why it failed—2222 isn't cPanel's SSL API port. Use 2087 for SSL instead.

5. Confirm cPanel User Permissions

Make sure the cPanel user account you're testing has permission to change their own password:

  1. Log into WHM as root.
  2. Go to Account Functions > Modify Account.
  3. Select the user account and check that the Change Password option is enabled.

Final Check

After making these changes, clear RoundCube's cache (delete files in roundcube/temp/ and roundcube/logs/ if needed) and restart your web server (systemctl restart httpd or systemctl restart nginx). Then try changing your password again.

内容的提问来源于stack exchange,提问作者Muntashir Are Rahi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:13:12