1

Topic: 2 php versions /mail showing 404 Not found

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2.2 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu 18.04.6 LTS
- 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.
====
Hello guys,

I have multiple websites(domains) on the server that work just fine with php 7.2 but i have that  one website that needed php 7.4, so i installed php7.4-fpm and added the following code to my nginx .conf file for that specific domain:

location ~ \.php$ {
      try_files $uri =404;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
   }

Restarted nginx and the website works just fine, email server works as intended in outlook, phones, etc, but roundcube just shows me a 404 Not found message.

I tried commenting the line that says "include /etc/nginx/templates/roundcube.tmpl;" and add the contents of that file into my .conf file and mess around with it but i couldn't get it to work.

I know i'm missing something but i just can't figure it out.

Any help will be appreciated.

Thanks

----

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

2

Re: 2 php versions /mail showing 404 Not found

afaik, php-fpm is by default configured to run on port 9999 and not with a unix socket

3

Re: 2 php versions /mail showing 404 Not found

Hi Cthulhu,

Thanks for your reply. I tried with fastcgi_pass   127.0.0.1:9999; and didn't work either.

4

Re: 2 php versions /mail showing 404 Not found

well, its impossible that both php versions run on same port

what software doesn't run on php 7.2?

5

Re: 2 php versions /mail showing 404 Not found

php 7.4 is running just fine, the website using it works but when i enter the /mail on the URL then i get the 404 not found page.

6

Re: 2 php versions /mail showing 404 Not found

ngonzalezi wrote:

when i enter the /mail on the URL then i get the 404 not found page.

It's a Nginx config issue (it doesn't reach php-fpm yet).

7

Re: 2 php versions /mail showing 404 Not found

ZhangHuangbin,

Any idea what am i missing?

8

Re: 2 php versions /mail showing 404 Not found

"404 not found" error means you don't have a `location {}` directive in Nginx config file to match Roundcube.

Check /etc/nginx/templates/roundcube.tmpl for reference.

Note: iRedMail uses few config snippets to handle php and Roundcube:

- /etc/nginx/conf-enabled/php_fpm.conf (it's a symlink to /etc/nginx/conf-available/php_fpm.conf)
- /etc/nginx/templates/roundcube.tmpl (and roundcube-subdomain.tmpl)
- /etc/nginx/sites-enabled/00-default-ssl.conf (it loads roundcube.tmpl to visit Roundcube)