Hi,
I’m getting a 500 Internal Error when I try to access the Roundcube webmail.
Checking /var/log/roundcube/errors.log, I see the following log entry:
PHP Fatal error: Uncaught Error: Call to undefined function array_last() in /var/lib/roundcube/program/include/rcmail_output_html.php:319
Stack trace:
#0 /var/lib/roundcube/program/include/rcmail_output_html.php(274): rcmail_output_html->load_skin()
#1 /var/lib/roundcube/program/include/rcmail_output_html.php(111): rcmail_output_html->set_skin()
#2 /var/lib/roundcube/program/include/rcmail_output_html.php(80): rcmail_output_html->init()
#3 /var/lib/roundcube/program/include/rcmail.php(589): rcmail_output_html->__construct()
#4 /var/lib/roundcube/program/include/rcmail.php(147): rcmail->load_gui()
#5 /var/lib/roundcube/program/include/rcmail.php(89): rcmail->startup()
#6 /var/lib/roundcube/public_html/index.php(43): rcmail::get_instance()
#7 {main}
thrown in /var/lib/roundcube/program/include/rcmail_output_html.php on line 319
- SO: Debian 12.15
- HestiaCP: 1.10.2
- Roundcube: 1.7.3
Before the installation everything was working fine. Any clues? Any commands you could give me? Thanks!
Hi,
Show the output of these commands:
grep -r RCMAIL_VERSION /var/lib/roundcube/program/include/iniset.php
ls -lart /var/lib/roundcube
php --version | head -1
apache2ctl -M | grep -Ei 'php|mpm'
Very fast…
grep -r RCMAIL_VERSION /var/lib/roundcube/program/include/iniset.php
define('RCMAIL_VERSION', '1.7.3');
ls -lart /var/lib/roundcube
total 496
drwxr-xr-x 2 hestiamail www-data 4096 Mar 13 2023 logs
-rw-r--r-- 1 hestiamail www-data 967 Mar 13 2023 SECURITY.md
-rw-r--r-- 1 hestiamail www-data 2551 Mar 13 2023 .htaccess
lrwxrwxrwx 1 hestiamail www-data 15 Mar 13 2023 config -> /etc/roundcube/
-rw-r--r-- 1 hestiamail www-data 26 Mar 13 2023 robots.txt
-rw-r--r-- 1 hestiamail www-data 124348 May 29 15:35 composer.lock
drwxr-xr-x 22 hestiamail www-data 4096 May 29 15:35 vendor
-rw-r--r-- 1 hestiamail www-data 4657 Jul 5 13:03 UPGRADING
-rw-r--r-- 1 hestiamail www-data 35147 Jul 5 13:03 LICENSE
-rw-r--r-- 1 hestiamail www-data 12714 Jul 5 13:03 INSTALL
-rw-r--r-- 1 hestiamail www-data 2357 Jul 18 01:22 .htaccess.new
drwxr-xr-x 35 root root 4096 Jul 31 08:48 ..
drwxr-xr-x 2 hestiamail www-data 4096 Aug 5 17:22 temp
drwxr-xr-x 7 hestiamail www-data 4096 Aug 9 10:45 SQL
-rw-r--r-- 1 hestiamail www-data 4057 Aug 9 10:45 README.md
-rw-r--r-- 1 hestiamail www-data 132 Aug 9 10:45 index.php
drwxr-xr-x 2 hestiamail www-data 4096 Aug 9 10:45 docs
drwxr-xr-x 3 hestiamail www-data 4096 Aug 9 10:45 skins
drwxr-xr-x 8 hestiamail www-data 4096 Aug 9 10:45 program
drwxr-xr-x 38 hestiamail www-data 4096 Aug 9 10:45 plugins
-rw-r--r-- 1 hestiamail www-data 233883 Aug 9 10:45 CHANGELOG.md
drwxr-xr-x 2 hestiamail www-data 4096 Aug 9 10:45 bin
drwxr-xr-x 2 hestiamail www-data 4096 Aug 14 01:22 public_html
-rw-r--r-- 1 hestiamail www-data 1296 Aug 14 01:22 composer.json-dist
-rw-r--r-- 1 hestiamail www-data 1437 Aug 14 01:22 composer.json
drwxr-xr-x 12 hestiamail www-data 4096 Aug 14 01:22 .
php --version | head -1
PHP 8.4.23 (cli) (built: Jul 3 2026 10:04:34) (NTS)
apache2ctl -M | grep -Ei 'php|mpm'
bash: apache2ctl: command not found (I use nginx)
I have also tried rebuilding the domains and restarting the nginx service, as you suggested in other threads. Thanks. I’m still here for you.
Execute this and try again, if you get any error, show the output (don’t copy/paste all the commands at once):
sudo -i
mv /var/lib/roundcube/composer.json /var/lib/roundcube/composer.json.bak
mv /var/lib/roundcube/composer.lock /var/lib/roundcube/composer.lock.bak
mv /var/lib/roundcube/composer.json-dist /var/lib/roundcube/composer.json
source /usr/local/hestia/conf/hestia.conf
COMPOSER_ALLOW_SUPERUSER=1 "/usr/bin/php" "-d disable_functions=" "/home/$ROOT_USER/.composer/composer" --working-dir="/var/lib/roundcube" update --no-dev --no-interaction --optimize-autoloader
No errors were encountered. It seems to be working correctly. Should I be concerned about future updates? Could a file be deleted or overwritten, causing the same error to appear? Thanks as always, Sahsanu.
I’m glad it fixed the issue.
The problem here is that Roundcube doesn’t overwrite composer.json. Instead, it adds the new version as composer.json-dist, so composer.json is never updated.
The complication is that we could overwrite composer.json to avoid these kinds of problems, but doing so could break the installation of someone who has modified composer.json because they’re using a plugin that requires those changes.