1

Topic: Roundcube not working after updating PHP version

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2.2
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  Mysql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
After updating from php7.2-fpm to php7.4-fpm i can not longer access roundcube, it keep saying 404 File Not Found.

I checked the fpm port at /etc/php/7.4/fpm/pool.d/www.conf same as in the site .conf file an everything is just fine.

I also stopped PHP7.2-fpm service

The website works just fine but round cube just doesn't work for some reason, is there any setting i need to change under roundcube config files?

Thank you

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Roundcube not working after updating PHP version

Simply copy /etc/php/7.2/fpm/pool.d/www.conf to /etc/php/7.4/fpm/pool.d/www.conf and restart php7.4-fpm service should fix the issue.

3

Re: Roundcube not working after updating PHP version

Hello Zhang i tried that and now i get a 502 error message.

My /etc/php/7.4/fpm/pool.d/www.conf content is as follows:

[inet]
user = www-data
group = www-data

listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

; IP addresses must be separated by comma, and no space between comma and ip.
listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 100
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 100

pm.status_path = /status
ping.path = /ping

request_terminate_timeout = 300
request_slowlog_timeout = 10s

;
; Log files
;
access.log = /var/log/php-fpm/php-fpm.log
slowlog = /var/log/php-fpm/slow.log

and my nginx conf file is:

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
    listen 443 ssl;
    #listen [::]:443 ssl;
    server_name mydomain.com mail.mydomain.com;

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



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

    include /etc/nginx/templates/misc.tmpl;
    include /etc/nginx/templates/ssl.tmpl;
    include /etc/nginx/templates/iredadmin.tmpl;
    include /etc/nginx/templates/roundcube.tmpl;
    include /etc/nginx/templates/sogo.tmpl;
    include /etc/nginx/templates/netdata.tmpl;
    include /etc/nginx/templates/php-catchall.tmpl;
    include /etc/nginx/templates/stub_status.tmpl;


location ~* \.(png|jpg|jpeg|gif)$ {
    expires 365d;
    add_header Cache-Control "public, no-transform";
}

location ~* \.(js|css|pdf|html|swf)$ {
    expires 30d;
    add_header Cache-Control "public, no-transform";
}

location ~* \.(jpg|jpeg|gif|png)$ {
    expires 365d;
}

location ~* \.(pdf|css|html|js|swf)$ {
    expires 30d;
}

location ~ ^/\.user\.ini {
deny all;
}

ssl_certificate /etc/letsencrypt/live/mydomain/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mydomain/privkey.pem; # managed by Certbot

}

4

Re: Roundcube not working after updating PHP version

I added this into my nginx .conf file

location ~ \.php$ {
      try_files $uri =404;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
   }

Now the website loads but still showing not found for /mail

5

Re: Roundcube not working after updating PHP version

Please include config snippet file /etc/nginx/templates/fastcgi_php.tmpl.

6

Re: Roundcube not working after updating PHP version

/etc/nginx/templates/fastcgi_php.tmpl.

#
# Template used to handle PHP fastcgi applications
#
# You still need to define `SCRIPT_FILENAME` for your PHP application, and
# probably `fastcgi_index` if your application use different index file.
#
include fastcgi_params;

# Directory index file
fastcgi_index index.php;

# Handle PHP files with upstream handler
#fastcgi_pass php_workers;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;

# Fix the HTTPROXY issue.
# Reference: https://httpoxy.org/
fastcgi_param HTTP_PROXY '';

i also noticed that i don't have a php7.4-fpm.sock at  /run/php/

7

Re: Roundcube not working after updating PHP version

I mean you should include /etc/nginx/templates/fastcgi_php.tmpl in your Nginx config file, so that it knows how to handle php scripts.