Roundcube stopped working with php 8.3

Hey,

I’ve installed php 8.3 thanks to those commands: How to install php8.3 for hestia

But I got a problem, nginx (As I am on a NGINX + PHPFPM config) wasn’t starting.

Apache2 started listening on port 80.

So I did a apt-get remove apache2 and nginx started again.

But, now, I don’t know if it is because of that or php 8.3, my webmail is showing me this:

Success!

Your new web server is ready to use.

Do you have an idea of what I should do?

Thanks in advance!

Hi @Nginxed,

That issue is pretty weird.

Try to rebuild the mail domain (replace YourUser and YourDomain with the actual data):

v-rebuild-mail-domain YourUser YourDomain

If that doesn’t work, show the output of these commands (replace YourUser and YourDomain with the actual data):

php -v
lsof -Pn +c0 -i:9000 -sTCP:LISTEN
ls -la /etc/roundcube/
ls -la /var/lib/roundcube/
v-list-sys-config json | grep -Ei 'WEB_|PROXY_|WEBMAIL_' | sed 's/^\s*//'
cat /home/YourUser/conf/mail/YourDomain/nginx.conf
cat /home/YourUser/conf/mail/YourDomain/nginx.ssl.conf

It looks like nginx config is overwritten by Nginx default…

Hey!

Thanks for your answer, I did the first command, now there is that showing on my webmail:

DATABASE ERROR
Database connection not successful
Please contact your server administrator.

2nd command did that:

# php -v
PHP 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 (cli) (built: Feb 15 2024 18:38:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.3-1+ubuntu22.04.1+deb.sury.org+1, Copyright (c), by Zend Technologies


# lsof -Pn +c0 -i:9000 -sTCP:LISTEN
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php-fpm8.3 812 root   15u  IPv4  23318      0t0  TCP 127.0.0.1:9000 (LISTEN)


# ls -la /etc/roundcube/
total 184
drwxr-x--x   3 root hestiamail  4096 févr. 17 05:19 .
drwxr-xr-x 125 root root       12288 févr. 17 05:16 ..
-rw-r--r--   1 root root        1212 oct.  23  2021 apache.conf
-rw-r--r--   1 root hestiamail  3704 févr. 17 05:16 config.inc.php
-rw-r--r--   1 root hestiamail  3995 févr. 17 05:18 config.inc.php.ucf-dist
-rw-r-----   1 root www-data     512 févr. 17 05:18 debian-db.php
-rw-r--r--   1 root root         373 oct.  23  2021 debian-db-roundcube.php
-rwxr-xr-x   1 root hestiamail 64583 févr. 17 05:16 defaults.inc.php
-rwxr-x--x   1 root hestiamail 62615 oct.  23  2021 defaults.inc.php.dpkg-dist
-rw-r--r--   1 root root        2552 oct.  23  2021 htaccess
-rw-r--r--   1 root root         503 oct.  23  2021 lighttpd.conf
-rwxr-x--x   1 root hestiamail  2760 févr. 17 05:16 mimetypes.php
-rwxr-x--x   1 root hestiamail  2806 oct.  17  2021 mimetypes.php.dpkg-dist
drwxr-x--x   6 root hestiamail  4096 févr. 17 05:18 plugins


# ls -la /var/lib/roundcube/
total 6284
drwxr-xr-x 13 root     hestiamail    4096 févr. 17 05:18 .
drwxr-xr-x 60 root     root          4096 févr. 17 05:16 ..
drwxr-xr-x  2 root     hestiamail    4096 févr. 17 05:16 bin
-rw-r--r--  1 root     hestiamail  212469 févr. 17 05:16 CHANGELOG.md
-rw-r--r--  1 root     hestiamail     994 févr. 17 05:16 composer.json
-rw-r--r--  1 root     hestiamail    1086 févr. 17 05:16 composer.json-dist
-rw-r--r--  1 root     hestiamail   56279 févr. 17 05:16 composer.lock
lrwxrwxrwx  1 root     hestiamail      15 févr. 17 05:16 config -> /etc/roundcube/
lrwxrwxrwx  1 root     root            23 oct.  23  2021 .htaccess -> /etc/roundcube/htaccess
lrwxrwxrwx  1 root     root            30 oct.  23  2021 index.php -> /usr/share/roundcube/index.php
-rw-r--r--  1 root     hestiamail   12661 févr. 17 05:16 INSTALL
drwxr-xr-x  3 root     hestiamail    4096 févr. 17 05:16 installer
-rw-r--r--  1 root     hestiamail   35147 févr. 17 05:16 LICENSE
drwxr-xr-x  2 root     hestiamail    4096 févr. 17 05:16 logs
drwxr-xr-x 37 root     hestiamail    4096 févr. 17 05:16 plugins
drwxr-xr-x  8 root     hestiamail    4096 févr. 17 05:16 program
drwxr-xr-x  3 root     hestiamail    4096 févr. 17 05:18 public_html
-rw-r--r--  1 root     hestiamail    3853 févr. 17 05:16 README.md
-rw-r--r--  1 root     hestiamail      26 févr. 17 05:16 robots.txt
drwxrwxr-x 13 root     hestiamail    4096 nov.   5 09:59 roundcubemail-1.6.5
-rw-r--r--  1 root     hestiamail 6028873 nov.   5 10:38 roundcubemail-1.6.5-complete.tar.gz
-rw-r--r--  1 root     hestiamail     967 févr. 17 05:16 SECURITY.md
drwxr-xr-x  3 root     hestiamail    4096 févr. 17 05:18 skins
drwxr-xr-x  7 root     hestiamail    4096 févr. 17 05:16 SQL
drwxr-x---  2 www-data www-data      4096 févr. 17 05:16 temp
-rw-r--r--  1 root     hestiamail    4657 févr. 17 05:16 UPGRADING
drwxr-xr-x 14 root     hestiamail    4096 févr. 17 05:16 vendor


# v-list-sys-config json | grep -Ei 'WEB_|PROXY_|WEBMAIL_' | sed 's/^\s*//'
"WEB_SYSTEM": "nginx",
"WEB_RGROUPS": "",
"WEB_PORT": "80",
"WEB_SSL": "openssl",
"WEB_SSL_PORT": "443",
"WEB_BACKEND": "php-fpm",
"PROXY_SYSTEM": "",
"PROXY_PORT": "",
"PROXY_SSL_PORT": "",
"WEBMAIL_ALIAS": "webmail",
"WEBMAIL_SYSTEM": "roundcube",
"POLICY_USER_EDIT_WEB_TEMPLATES": "yes",


# cat /home/myuser/conf/mail/support-e-mail.com/nginx.conf
server {
	listen     MYIPHIDDEN:80;
	server_name webmail.support-e-mail.com mail.support-e-mail.com;
	root        /var/lib/roundcube;
	index       index.php index.html index.htm;
	access_log  /var/log/nginx/domains/webmail.support-e-mail.com.log combined;
	error_log   /var/log/nginx/domains/webmail.support-e-mail.com.error.log error;

	include /home/myuser/conf/mail/support-e-mail.com/nginx.forcessl.conf*;

	location ~ /\.(?!well-known\/) {
		deny all;
		return 404;
	}

	location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
		deny all;
		return 404;
	}

	location / {
		try_files $uri $uri/ =404;

		location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
			expires 7d;
			fastcgi_hide_header "Set-Cookie";
		}

		location ~ ^/(.*\.php)$ {
			include /etc/nginx/fastcgi_params;

			fastcgi_index index.php;
			fastcgi_param SCRIPT_FILENAME $request_filename;

			fastcgi_pass  127.0.0.1:9000;
		}
	}

	location /error/ {
		alias /var/www/document_errors/;
	}

	include /home/myuser/conf/mail/support-e-mail.com/nginx.conf_*;
}


# cat /home/myuser/conf/mail/support-e-mail.com/nginx.ssl.conf
server {
	listen     MYIPHIDDEN:443 ssl;
	server_name webmail.support-e-mail.com mail.support-e-mail.com;
	root        /var/lib/roundcube;
	index       index.php index.html index.htm;
	access_log  /var/log/nginx/domains/webmail.support-e-mail.com.log combined;
	error_log   /var/log/nginx/domains/webmail.support-e-mail.com.error.log error;

	ssl_certificate     /home/myuser/conf/mail/support-e-mail.com/ssl/support-e-mail.com.pem;
	ssl_certificate_key /home/myuser/conf/mail/support-e-mail.com/ssl/support-e-mail.com.key;
	ssl_stapling        on;
	ssl_stapling_verify on;

	# TLS 1.3 0-RTT anti-replay
	if ($anti_replay = 307) { return 307 https://$host$request_uri; }
	if ($anti_replay = 425) { return 425; }

	location ~ /\.(?!well-known\/) {
		deny all;
		return 404;
	}

	location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
		deny all;
		return 404;
	}

	location / {
		try_files $uri $uri/ =404;

		location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
			expires 7d;
			fastcgi_hide_header "Set-Cookie";
		}

		location ~ ^/(.*\.php)$ {
			include /etc/nginx/fastcgi_params;

			fastcgi_index index.php;
			fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
			fastcgi_param SCRIPT_FILENAME $request_filename;

			fastcgi_pass  127.0.0.1:9000;
		}
	}

	location /error/ {
		alias /var/www/document_errors/;
	}

	proxy_hide_header Upgrade;

	include /home/myuser/conf/mail/support-e-mail.com/nginx.ssl.conf_*;
}

Thanks! :slight_smile:

Note: Next time, execute the commands one by one and when pasting the output, leave separations between the command because it’s a pain to read it :wink: (this time I’ve fixed it in your post).


Did you install roundcube using apt?

dpkg -l 'roundcube*' | grep ^ii

If you see that roundcube is installed you should remove it and reinstall it using Hestia script, to do it, follow these steps:

If roundcube was not installed using distro packages, check whether the db exists:

mysql -uroot -e 'use roundcube; show tables;'

If you can see the tables, then maybe the password being used in roundcube conf is not the same as for roundcube user in the db.

Check what is the password being used by roundcube:

grep db_dsnw /etc/roundcube/config.inc.php

And you should see an output like this:

$config["db_dsnw"] = "mysql://roundcube:abc123ABC34501yz@localhost/roundcube";

Where abc123ABC34501yz would be the password used so try to modify it for the db user:

mysql -uroot -e 'ALTER USER "roundcube"@"localhost" IDENTIFIED BY "abc123ABC34501yz"; flush privileges;'

Change roundcube dir perms:

chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/

And try to connect to webmail again.

1 Like

Oh okay, sorry!

Thank you so much, the first one worked!

You made my day :smiley:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.