CentOS 7.5+CWP环境下Roundcube登录500内部服务器错误求助
Hey there, let's get this Roundcube issue sorted out for you. Looking at your error log, the root cause is obvious: the Net_IDNA2 PHP class that Roundcube depends on isn't installed, which triggers a fatal error when the login process tries to run the idn_to_ascii function. Here's a straightforward fix:
Step 1: Install PEAR (if it's not already on your system)
CentOS 7 doesn't come with PEAR pre-installed by default, so let's add it first:
yum install php-pear -y
Step 2: Install the Net_IDNA2 package
Now use PEAR to install the missing dependency Roundcube needs:
pear install Net_IDNA2
If you run into version conflicts during installation, try specifying a stable release:
pear install Net_IDNA2-0.1.1
Step 3: Verify installation and restart services
After installing, double-check that Net_IDNA2 is listed in your PEAR packages:
pear list | grep Net_IDNA2
If you see it in the output, the install worked. Now restart your web server and PHP-FPM to make sure the changes take effect:
# For Apache (common with CWP) systemctl restart httpd # For PHP-FPM systemctl restart php-fpm
Extra checks if the problem persists
If you still see the blank page after the above steps, a couple more things to verify:
- Make sure your PHP
include_pathincludes the PEAR directory. You can check this with:
The path should includegrep include_path /etc/php.ini.:/usr/share/pear(that's where PEAR installs packages by default). - Double-check that Roundcube's bootstrap file has access to the Net_IDNA2 class—though installing the package via PEAR should handle this automatically.
Once you've gone through these steps, you should be able to log into Roundcube without hitting that 500 error.
内容的提问来源于stack exchange,提问作者Husain Khanbahadur

