1 (edited by Vortex 2020-12-30 20:13:06)

Topic: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer?  Upgraded from previous version installed by downloadable installer.
- Linux/BSD distribution name and version: Ubuntu 18.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? iRedAdmin
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello, I have upgraded to PHP 7.4 and all is well.  iRedAdmin is working well but after reboot to check I found that Roundcube is not working anymore.  It was working before the reboot.
I've searched and checked the configurations, but cannot find the issue.
I'm sure it's simple due the to PHP upgrade but can't find it.
Any ideas are welcome, thank you.
Greg

ADDED 20 Dec - I'm having trouble deciphering this log file.  Using port 4434 deliberately, iRedAdmin runs fine on this port.  (also Roundcube is V1.4.9 I didn't change the folder name when upgrading)

nginx_error_log wrote:

2020/12/20 10:32:04 [error] 10188#10188: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function mb_internal_encoding() in /opt/www/roundcubemail-1.4.7/program/lib/Roundcube/bootstrap.php:86
Stack trace:
#0 /opt/www/roundcubemail-1.4.7/program/include/iniset.php(62): require_once()
#1 /opt/www/roundcubemail-1.4.7/index.php(40): require_once('/opt/www/roundc...')
#2 {main}
  thrown in /opt/www/roundcubemail-1.4.7/program/lib/Roundcube/bootstrap.php on line 86" while reading response header from upstream, client: 45.248.78.164, server: _, request: "GET /mail/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "XXX.XXX.XXX.XX:4434"
This is line 86 of bootstrap.php  mb_internal_encoding(RCUBE_CHARSET);

Here is the result of php -m wrote:

# php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

logs wrote:

php-fpm
127.0.0.1 -  20/Dec/2020:11:44:25 +1100 "GET /mail/index.php" 500
127.0.0.1 -  20/Dec/2020:11:48:41 +1100 "GET /mail/index.php" 500
127.0.0.1 -  20/Dec/2020:11:49:05 +1100 "GET /mail/index.php" 500
php7.5-fpm
[20-Dec-2020 12:03:23] NOTICE: fpm is running, pid 12774
[20-Dec-2020 12:03:23] NOTICE: ready to handle connections
[20-Dec-2020 12:03:23] NOTICE: systemd monitor interval set to 10000ms

----

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

2

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

i've been running roundcube on php7.4 for a while now, no problems since installing (on ubuntu 20.04, with php7.4, and nginx forwarding).

maybe you could try re-installing iRedMail?
or just run the installation script on top of what you got now?

3

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

also : it's not advised to keep running ubuntu 18.04 when 20.04 has been fully released.
by now, 18.04 has got some serious security holes in it.
found that out myself the hard way when someone abused my apache to host phishing files

4

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

rene.veerman wrote:

i've been running roundcube on php7.4 for a while now, no problems since installing (on ubuntu 20.04, with php7.4, and nginx forwarding).

maybe you could try re-installing iRedMail?
or just run the installation script on top of what you got now?

Thanks for your reply.
Yes, I don't have any other problem than Roundcube running under Nginx.  The iRedAdmin works fine also on Nginx.  And have done a re-install of Roundcube. 
I believe it will be a config in Roundcube somewhere but I can't locate it.

5

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

rene.veerman wrote:

also : it's not advised to keep running ubuntu 18.04 when 20.04 has been fully released.
by now, 18.04 has got some serious security holes in it.
found that out myself the hard way when someone abused my apache to host phishing files

Thanks, tried to upgrade to 20.04 but iRedmail didn't like it so I went back to 18.4

6

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

rene.veerman wrote:

i've been running roundcube on php7.4 for a while now, no problems since installing (on ubuntu 20.04, with php7.4, and nginx forwarding).

maybe you could try re-installing iRedMail?
or just run the installation script on top of what you got now?

Thanks again.  I have done a re-install of Roundcube without success.  I'm reluctant to re-install iRedMail because all is working well.  It's just the Roundcube webmail that's not working.

I think the solution lies with either/or php, php-fpm and Roundcube, but not sure how to find it.

7

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

If you upgraded php from 7.2 to 7.4. make sure you're running "php7.4-fpm" service and NOT "php7.2-fpm".

8

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

Vortex wrote:

Thanks, tried to upgrade to 20.04 but iRedmail didn't like it so I went back to 18.4

It should be fine now since all our Python applications moved to Python 3 (Ubuntu 20.04 drops Python 2).

9

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

Thanks for your assistance Zhang.  I have ensure both service are not running and only "php7.4-fpm" is running.  It still a problem though.  This is the entry from nginx/error.log

2020/12/23 10:28:38 [error] 11005#11005: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: _, request: "GET /mail/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "xxx.xxxx.com:4434"

I cannot see where this issue is coming from, because both Netdata and iRedAdmin are running well.

10 (edited by Vortex 2020-12-23 07:56:34)

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

Vortex wrote:

Thanks, tried to upgrade to 20.04 but iRedmail didn't like it so I went back to 18.4

Thank you, I will take time to do a full upgrade.

11

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

rene.veerman wrote:

maybe you could try re-installing iRedMail?

woow!! a lot of interisting points in this post.

I hope I'll never need this, but could be a solution re-installing iRedMail on top of a running server?

Is it a recommended procedure, if only one component is damaged?
Thanks, bye.

12

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

ms2504 wrote:
rene.veerman wrote:

maybe you could try re-installing iRedMail?

woow!! a lot of interisting points in this post.

I hope I'll never need this, but could be a solution re-installing iRedMail on top of a running server?

Is it a recommended procedure, if only one component is damaged?
Thanks, bye.

I will not reinstall. I moved Roundcube to Apache2 and it works fine

13

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

Vortex wrote:

Thanks for your assistance Zhang.  I have ensure both service are not running and only "php7.4-fpm" is running.  It still a problem though.  This is the entry from nginx/error.log

2020/12/23 10:28:38 [error] 11005#11005: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: _, request: "GET /mail/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "xxx.xxxx.com:4434"

I cannot see where this issue is coming from, because both Netdata and iRedAdmin are running well.

Is your php7.4-fpm running on port 9999?

14 (edited by Vortex 2020-12-28 13:20:29)

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

Zhang wrote:

Is your php7.4-fpm running on port 9999

Thanks for your reply.  I run lsof -P | grep TCP | grep LISTEN or netstat -tulpn or netstat -an | grep :9999 and there is no reference to php7.4-fpm  from the output.  However if I run service php7.4-fpm status the service is running (active).  I'm not sure where to go from here? and

15

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

Check /etc/php/7.4/fpm/pool.d/www.conf. make sure it's running on port 9999.

listen = 127.0.0.1:9999

16

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

ZhangHuangbin wrote:

Check /etc/php/7.4/fpm/pool.d/www.conf. make sure it's running on port 9999.

listen = 127.0.0.1:9999
Vortex wrote:

Thank you.  This was commented out:

;;; Copied from www.conf 7.2
;listen = 127.0.0.1:9999
;listen.mode = 0660
;listen.allowed_clients = 127.0.0.1
;;;

Should I uncomment all or only this one listen = 127.0.0.1:9999 or all?

17

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

All 3 listen* parameters.

18

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

ZhangHuangbin wrote:

All 3 listen* parameters.

Thank you Zhang.  I have uncommented the 3 parameters as noted and re-start ngnix.  Still no luck sadly.  Now getting an error 502 Bad Gateway.  Here is the results of the

log wrote:

2020/12/30 09:45:22 [error] 6253#6253: *5 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: _, request: "GET /mail/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "mx.domain.com:4434"

and

netstat wrote:

[Admin@MX root]# netstat -an | grep :9999
[Admin@MX root]#

I'm not knowing where to find the problem.  As I say iRedAdmin and netdata are working well, as are all other functions of iRedMail.

19

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

- Run "ps aux |grep php" to figure out which php release is running.
- Check /etc/php/<php-version>/fpm/php-fpm.conf, make sure its "included=" parameter loads /etc/php/<php-version>/fpm/pool.d/*.conf like this:

include=/etc/php/7.2/fpm/pool.d/*.conf

Then restart php7.X-fpm service (replace "X" by the real version number).

20

Re: [SOLVED] After PHP 7.4 upgrade Roundcube gives HTTP ERROR 500

[SOLVED]
Thanks again.  All is in order as your suggestion.

ps aux |grep php wrote:
root       886  0.0  0.0 511304    92 ?        Ss   Dec28   0:07 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
www-data  1185  0.0  0.0 513600     4 ?        S    Dec28   0:00 php-fpm: pool www
www-data  1186  0.0  0.0 513600     4 ?        S    Dec28   0:00 php-fpm: pool www
root     15458  0.0  0.0   4632   812 ?        S    23:02   0:00 sh -c (ps aux |grep php) 2>&1
root     15459  0.0  0.0   4632    88 ?        S    23:02   0:00 sh -c (ps aux |grep php) 2>&1
root     15461  0.0  0.0  11464  1028 ?        S    23:02   0:00 grep php
include=/etc/php/7.2/fpm/pool.d/*.conf wrote:
include=/etc/php/7.4/fpm/pool.d/*.conf

I have then done a  service php7.4-fpm restart and it is working.  I have rebooted a few times previously, so am puzzled as to why it wasn't working, but now it does. 
Thanks very much for your patience and helping me work thru this.  I'll leave it as a mystery.  Cheers.