Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: Dmitry42 on October 20, 2025, 08:37:53 AM

Title: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 20, 2025, 08:37:53 AM
I vas used 1.7 git version for 1-2 years. Now I want update to current 1.7 git or 1.7 beta 2.
And I have problem with interface.

At this moment i try drop Roundcube database,  i try delete RC web-site folder and use full new files from RC 1.7beta2 archive. I update all with composer.

Only one what I use old - its config file, but in config file I switch off all plugins and set elastic as default skin.

I use nginx, and I pass test from installer.php.

Can't understand what I can do to repair interface.

I need your help, please!
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 20, 2025, 08:45:15 AM
and one new difference between my old RC 1.7 and current new - its using /public_html - but I update nginx config file :

server {
    listen 443 ssl http2;
    server_name localhost;
    root /var/www/html/webmail/public_html;
    index index.php;

May be nginx can't get access upper than public_html ....?
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: SKaero on October 20, 2025, 10:44:01 AM
What errors do you have in the browser console? It looks like your not getting the static assets, in 1.7 they are all served from the static.php file so I'm guessing there is a problem with the nginx config accessing that file.
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on October 20, 2025, 01:52:34 PM
OK, I've exactly the same problem...

Nginx on Debian 12.

No warning or error in logs...
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: SKaero on October 20, 2025, 02:55:24 PM
The errors would be in the browser console not the Roundcube error logs.
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: alec on October 21, 2025, 02:28:06 AM
I have something like this in the nginx config:
location ~ \.php(/.+)?$ {
    #rewrite "^/[a-zA-Z0-9]{16}/(.*)$" /$1;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index  index.php;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO $fastcgi_path_info;
    fastcgi_pass   php-fpm;
}
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 23, 2025, 01:37:28 PM
Hi! Thank you for answer! Im little late -have problem with internet access.

Yes I sow in nginx logs that new RC use static.php for work, so I think too its can be problem with nginx config.

Here is part of my nginx config:
server {
    listen 443 ssl http2;
    server_name 10.1.1.2;
    root /var/www/html/webmail/public_html;
    index index.php;
 
    location ~ \.php(?:$|/) {
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_intercept_errors on;
        fastcgi_buffers 4 256k;
        fastcgi_busy_buffers_size 256k;
fastcgi_read_timeout 180s;
    }

Unfortunately I have not experience and knowledge to understanding have this config critical errors or not. As I can see, basically it looks like Alec sample.
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 23, 2025, 01:39:05 PM
Quote from: SKaero on October 20, 2025, 02:55:24 PMThe errors would be in the browser console not the Roundcube error logs.

I check it and come back with answers. Thank you for your help.
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 26, 2025, 12:36:34 PM
So im come back. I check browser console and yes - problem with access to files.


bootstrap.min.css:1
 Failed to load resource: the server responded with a status of 404 ()
styles.min.css:1
 Failed to load resource: the server responded with a status of 404 ()
elastic.css:1
 Failed to load resource: the server responded with a status of 404 ()
styles.css:1
 Failed to load resource: the server responded with a status of 404 ()
styles.css:1
 Failed to load resource: the server responded with a status of 404 ()
elastic.css:1
 Failed to load resource: the server responded with a status of 404 ()
jquery-ui.min.css:1
 Failed to load resource: the server responded with a status of 404 ()
custom.php:1
 Failed to load resource: the server responded with a status of 404 ()
scripts.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
jquery.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
common.js:1
 Failed to load resource: the server responded with a status of 404 ()
js.cookie.js:1
 Failed to load resource: the server responded with a status of 404 ()
app.js:1
 Failed to load resource: the server responded with a status of 404 ()
xskin.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
framework.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
howler.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
jquery-ui.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
alarm.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
datepicker-en-GB.js:1
 Failed to load resource: the server responded with a status of 404 ()
bootstrap.bundle.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
ui.min.js:1
 Failed to load resource: the server responded with a status of 404 ()
(index):44 Uncaught ReferenceError: rcube_webmail is not defined
    at (index):44:14
(index):92 Uncaught ReferenceError: $ is not defined
    at (index):92:1
/static.php/skins/el....ico?s=1760867757:1
 Failed to load resource: the server responded with a status of 404 ()

I can't understand how static.php must use files from folder upper than nginx root.

Can you show your nginx SERVER section ? How you config root folder ?
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: SKaero on October 26, 2025, 09:45:53 PM
I wonder if your $_SERVER['PATH_INFO'] value is invalid or empty. If you create a php file with the following what does it output?
<?php
echo $_SERVER['PATH_INFO'];
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 27, 2025, 11:55:46 AM
Quote from: SKaero on October 26, 2025, 09:45:53 PMI wonder if your $_SERVER['PATH_INFO'] value is invalid or empty. If you create a php file with the following what does it output?
<?php
echo $_SERVER['PATH_INFO'];

I think you are right. Your php script output plank page - nothing. So I will search and read about setup this variable. Thank you!

I'l back later with any news.
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 27, 2025, 12:39:27 PM
Im come back. I find that :

QuoteThe try_files directive changes URI of a request to the one matched on the file system, and subsequent attempt to split the URI into $fastcgi_script_name and $fastcgi_path_info results in empty path info - as there is no path info in the URI after try_files.

So the my solution was backup $fastcgi_path_info and restore after try_files.

    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
       
        set $backup  $fastcgi_path_info;
        try_files $uri = 404;
        fastcgi_param PATH_INFO $backup;


THANK YOU!!!
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 27, 2025, 12:57:35 PM
But it was not the end ))))

Still have problem with "try_files" and now its problem with new mail composer - can't  switch to HTML editor and with one of calendar plugins:
Quote2025/10/27 23:47:54 [error] 230452#230452: *240 open() "/var/www/html/webmail/public_html404" failed (2: No such file or directory), client: 192.168.6.210, server: mail, request: "GET /static.php/program/js/publickey.js?s=1761116479 HTTP/2.0", host: "10.1.1.1", referrer: "https://10.1.1.1/?_task=mail&_action=compose&_id=6815834868ffa239d049f"

I remove "try_files" from config and all working fine. So i will search solution to check user request with try_files and not broke my RC publication.


Im back later with solution
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on October 28, 2025, 06:31:04 AM
I've the same problem... now share my nginx conf (works fine on 1.6.x):

Any idea ?

*************************
        root /var/www/html/public_html;
        index index.php;

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
                deny all;
        }

        location ~ ^/(config|temp|logs|SQL|bin)/ {
                deny all;
        }

        location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include fastcgi_params;
        }
*************************
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 28, 2025, 11:52:50 AM
looks like you have the same problem.
Try comment or remove 'try-files'

 
Quote# try_files $uri =404;
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 28, 2025, 01:25:27 PM
I use this
<?php
echo '-';
echo 
$_SERVER['PATH_INFO'];
echo 
'-';
echo 
$_SERVER['SCRIPT_FILENAME'];
echo 
'';

https://10.1.1.1/tets.php/123

QuotePATH_INFO /123
SCRIPT_FILENAME /var/www/html/webmail/public_html/tets.php

if I use try_files then:
the same URL https://10.1.1.1/tets.php/123 give me
Quote404 Not Found

and https://10.1.1.1/tets.php give me
QuotePATH_INFO empty
SCRIPT_FILENAME /var/www/html/webmail/public_html/tets.php
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 28, 2025, 01:52:21 PM
now I test config like this:

    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;

        if (!-f $document_root$fastcgi_script_name) {
                return 404;
        }

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_intercept_errors on;
        fastcgi_buffers 4 256k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_read_timeout 180s;
    }

replace TRY_FILES with IF
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on October 29, 2025, 02:59:56 PM
no, it doesn't work.

Black and white page that require login.. no skin, no graphics.

try_files $uri = 404; commented and nginx restarted....
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 30, 2025, 12:10:29 PM
try comment all try_files in you nginx config
and check what you see in /var/log/nginx/error.log

and you try update all with composer from RC root directory (when composer.json placed)?
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on October 30, 2025, 04:54:54 PM
OK !

this is my setting:


*************************
        root /var/www/html/public_html;
        index index.php;

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
                deny all;
        }

        location ~ ^/(config|temp|logs|SQL|bin)/ {
                deny all;
        }

        location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include fastcgi_params;
        }
*************************

I should remove:

                try_files $uri =404;
and at this point:

location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

how should I change the configuration?

Thanks !!

Luca
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on October 31, 2025, 01:50:59 PM
yes try...and what about error.log and composer ?
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on October 31, 2025, 08:40:09 PM
OK, I've commented try_files sections.
The error persist, no skin.

these are the errors in log:

*****************************
2025/11/01 01:22:57 [error] 1901155#1901155: *14 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /vendor/autoload.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mail.xxx.xxx"
2025/11/01 01:22:57 [error] 1901155#1901155: *14 open() "/var/www/html/public_html/favicon.ico" failed (2: No such file or directory), client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /favicon.ico HTTP/2.0", host: "mail.xxx.xxx", referrer: "https://mail.xxx.xxx/vendor/autoload.php"
2025/11/01 01:23:40 [error] 1901155#1901155: *14 access forbidden by rule, client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /config/config.inc.php HTTP/2.0", host: "mail.xxx.xxx"
2025/11/01 01:27:50 [error] 1901154#1901154: *18 open() "/var/www/html/public_html/static.php/skins/elastic/deps/bootstrap.min.css" failed (20: Not a directory), client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /static.php/skins/elastic/deps/bootstrap.min.css?s=1759310275 HTTP/2.0", host: "mail.xxx.xxx", referrer: "https://mail.xxx.xxx/"
2025/11/01 01:27:50 [error] 1901154#1901154: *18 open() "/var/www/html/public_html/static.php/skins/elastic/styles/styles.min.css" failed (20: Not a directory), client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /static.php/skins/elastic/styles/styles.min.css?s=1759310266 HTTP/2.0", host: "mail.xxx.xxx", referrer: "https://mail.xxx.xxx/"
2025/11/01 01:27:50 [error] 1901154#1901154: *18 open() "/var/www/html/public_html/static.php/plugins/jqueryui/themes/elastic/jquery-ui.min.css" failed (20: Not a directory), client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /static.php/plugins/jqueryui/themes/elastic/jquery-ui.min.css?s=1759310265 HTTP/2.0", host: "mail.xxx.xxx", referrer: "https://mail.xxx.xxx/"
2025/11/01 01:27:50 [error] 1901154#1901154: *18 open() "/var/www/html/public_html/static.php/program/js/jquery.min.js" failed (20: Not a directory), client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /static.php/program/js/jquery.min.js?s=1759310271 HTTP/2.0", host: "mail.xxx.xxx", referrer: "https://mail.xxx.xxx/"
2025/11/01 01:27:50 [error] 1901154#1901154: *18 open() "/var/www/html/public_html/static.php/program/js/common.min.js" failed (20: Not a directory), client: xxx.xxx.xxx.xxx, server: mail.xxx.xxx, request: "GET /static.php/program/js/common.min.js?s=1759310265 HTTP/2.0", host: "mail.xxx.xxx", referrer: "https://mail.xxx.xxx/"
*****************************
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: Dmitry42 on November 02, 2025, 12:46:39 PM
what about file access rights to files and folders in /var/www/html/ ?
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on November 02, 2025, 04:12:42 PM
.... version 1.6.11 works perfectly.

The roundcube directory has owner www-data, upgrade to 1.7.beta done by "install-to.sh in /bin", as usual.

Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: SKaero on November 03, 2025, 10:49:19 AM
The error log shows that nginx is not spiting the path information so the issue is the nginx config not permissions.

Looking at your full config:
        root /var/www/html/public_html;
        index index.php;

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
                deny all;
        }

        location ~ ^/(config|temp|logs|SQL|bin)/ {
                deny all;
        }

        location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include fastcgi_params;
        }

I think this block is capturing all the requests, lets remove it.
        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }


You can remove these since the change in 1.7 they are no longer in the public directly and therefore can't be accessed anyways.
        location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
                deny all;
        }

        location ~ ^/(config|temp|logs|SQL|bin)/ {
                deny all;
        }

This block would only look at paths that end in .php, the problem is the static.php file paths don't end that way "/var/www/html/public_html/static.php/skins/elastic/deps/bootstrap.min.css" so lets replace with the block below.
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include fastcgi_params;
        }

This block comes from alec's post and it looks for .php anywhere in the request path and I modified the fastcgi_pass to point to your unix socket. Try that and see if it works or gives you any different errors.
location ~ \.php(/.+)?$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index  index.php;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO $fastcgi_path_info;
    fastcgi_pass   unix:/var/run/php/php8.2-fpm.sock;
}
Title: Re: Im confused from updating from 1.7 to fresh 1.7
Post by: dea75 on November 03, 2025, 04:30:23 PM
Ohhh good !
it works like a charm !
I'll try the various functions but everything seems to be working as it should.

However, I think Roundcube should specify recommended nginx settings. I found very little about this, and all the settings were tied to older versions (from at least a few years ago).

Thanks again!