[SOLVED] ISPconfig Error 500

Discussion in 'Installation/Configuration' started by Davide Del Gatto, Mar 7, 2019.

  1. Davide Del Gatto

    Davide Del Gatto New Member

    Hi everyone :D
    Even today I updated my private VPS with ISPconfig 3.1.13 (I updated just the system, not ISPconfig)
    I worked a little bit on it and tonight when I opening the normal dashboard I saw the ERROR 500 :(
    Well, the website on this VPS works well but I can't to see the ISPconfig dashboard.

    I started to investigate and I saw this code:

    Code:
    [Wed Mar 06 23:05:53.693315 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined function mb_detect_encoding() in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php:479
    [Wed Mar 06 23:05:53.693348 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: Stack trace:
    [Wed Mar 06 23:05:53.693352 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php(155): db->escape('interface')
    [Wed Mar 06 23:05:53.693367 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php(259): db->_build_query_string('SELECT `value` ...', 'interface', 'session_timeout')
    [Wed Mar 06 23:05:53.693370 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php(298): db->_query('SELECT `value` ...', 'interface', 'session_timeout')
    [Wed Mar 06 23:05:53.693373 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #3 /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php(317): db->query('SELECT `value` ...', 'interface', 'session_timeout')
    [Wed Mar 06 23:05:53.693376 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #4 /usr/local/ispconfig/interface/lib/app.inc.php(165): db->queryOneRecord('SELECT `value` ...', 'interface', 'session_timeout')
    [Wed Mar 06 23:05:53.693380 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #5 /usr/local/ispconfig/interface/lib/app.inc.php(72): app->conf('interface', 'session_timeout')
    [Wed Mar 06 23:05:53.693383 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #6 /usr/local/ispconfig/interface/lib/app.inc.php(340): app->__construct()
    [Wed Mar 06 23:05:53.693386 2019] [fcgid:warn] [pid 5820] [client XXX.XXX.XXX.XXX:3652] mod_fcgid: stderr: #7 /usr/local/ispconfig/interface/web/index.php(32): require_once('/usr/ in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 479
    My PHP version it's PHP 7.2.15

    Code:
    root@vps1:/var/tmp# php -v
    PHP 7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0 (cli) (built: Feb  9 2019 06:51:24) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0, Copyright (c) 1999-2018, by Zend Technologies
    
    This's my htf_report.txt

    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.1.13
    
    ##### VERSION CHECK #####
    [INFO] php (cli) version is 7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0
    
    ##### PORT CHECK #####
    [WARN] Port 143 (IMAP server) seems NOT to be listening
    [WARN] Port 993 (IMAP server SSL) seems NOT to be listening
    [WARN] Port 110 (POP3 server) seems NOT to be listening
    [WARN] Port 995 (POP3 server SSL) seems NOT to be listening
    [WARN] Port 25 (SMTP server) seems NOT to be listening
    [WARN] Port 465 (SMTP server SSL) seems NOT to be listening
    [WARN] Port 22 (SSH server) seems NOT to be listening
    [WARN] Port 25 (SMTP server) seems NOT to be listening
    
    ##### MAIL SERVER CHECK #####
    [WARN] I found no "smtp" entry in your postfix master.cf
    [WARN] I found no "submission" entry in your postfix master.cf
    [INFO] this is not critical, but if you want to offer port 587 for smtp connections you have to enable this.
    [WARN] I found no "smtps" entry in your postfix master.cf
    [INFO] this is not critical, but if you want to offer SSL for smtp (not TLS) connections you have to enable this.
    
    ##### RUNNING SERVER PROCESSES #####
    [INFO] I found the following web server(s):
            Apache 2 (PID 5779)
    [WARN] I could not determine which mail server is running.
    [WARN] I could not determine which pop3 server is running.
    [WARN] I could not determine which imap server is running.
    [INFO] I found the following ftp server(s):
            PureFTP (PID 3146)
    
    ##### LISTENING PORTS #####
    (only           ()
    Local           (Address)
    [anywhere]:6379         (2809/redis-server)
    [anywhere]:41323                (1595/rpc.statd)
    [anywhere]:111          (1567/rpcbind)
    [anywhere]:21           (3146/pure-ftpd)
    [anywhere]:2269         (3210/sshd)
    *:*:*:*::*:3306         (2742/mysqld)
    *:*:*:*::*:6379         (2809/redis-server)
    *:*:*:*::*:40335                (1595/rpc.statd)
    [localhost]11           (1567/rpcbind)
    *:*:*:*::*:80           (5779/apache2)
    *:*:*:*::*:8080         (5779/apache2)
    *:*:*:*::*:8081         (5779/apache2)
    *:*:*:*::*:21           (3146/pure-ftpd)
    *:*:*:*::*:443          (5779/apache2)
    *:*:*:*::*:2269         (3210/sshd)
    
    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    f2b-pure-ftpd  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 21
    f2b-sshd   tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 2269
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain f2b-pure-ftpd (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    Chain f2b-sshd (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    and then I found a few links to edit the file /etc/apache2/mods-available/fcgid.conf and I changed my file in this way but anything is changed

    PHP:
    <IfModule mod_fcgid.c>
      
    FcgidConnectTimeout 20
      MaxRequestLen 15728640
      
    <IfModule mod_mime.c>
        
    AddHandler fcgid-script .fcgi
      
    </IfModule>
    </
    IfModule>
    This's my modules alredy enabled in Apache2

    Code:
    Loaded Modules:
     core_module (static)
     so_module (static)
     watchdog_module (static)
     http_module (static)
     log_config_module (static)
     logio_module (static)
     version_module (static)
     unixd_module (static)
     access_compat_module (shared)
     actions_module (shared)
     alias_module (shared)
     auth_basic_module (shared)
     authn_core_module (shared)
     authn_file_module (shared)
     authz_core_module (shared)
     authz_host_module (shared)
     authz_user_module (shared)
     autoindex_module (shared)
     cgi_module (shared)
     deflate_module (shared)
     dir_module (shared)
     env_module (shared)
     fcgid_module (shared)
     filter_module (shared)
     headers_module (shared)
     http2_module (shared)
     include_module (shared)
     mime_module (shared)
     mpm_prefork_module (shared)
     negotiation_module (shared)
     pagespeed_module (shared)
     passenger_module (shared)
     php7_module (shared)
     proxy_module (shared)
     proxy_fcgi_module (shared)
     python_module (shared)
     reqtimeout_module (shared)
     rewrite_module (shared)
     setenvif_module (shared)
     socache_shmcb_module (shared)
     ssl_module (shared)
     status_module (shared)
     suexec_module (shared)
    
    Any ideas??

    Thank you so much in advance!
    Kind regards
    Davide
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Install php7.2-mbstring
     
  3. Davide Del Gatto

    Davide Del Gatto New Member

    Hi @Jesse Norell but php7.2-mbstring it's already installed :(

    Code:
    # apt install php7.2-mbstring
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    php7.2-mbstring is already the newest version (7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0).
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
    
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    function mb_detect_encoding() is defined in mbstring.so, if you have it installed, perhaps it's not loaded? I'm guessing you have ubuntu 18, as that's the only OS version where 7.2 is supported, but as your php version string includes "stretch", I'll ask - what OS are you running? I don't have a ubuntu server setup, but in debian 9 with sury repos, the mbstring extension would be loaded by /etc/php/7.2/{mode}/conf.d/20-mbstring.ini, you might check those files (one for each mode) and ensure the "extension=mbstring.so" line is not commented out. Maybe restart your php daemon if you haven't lately.
     
  5. Davide Del Gatto

    Davide Del Gatto New Member

    @Jesse Norell I have Debian 9 look

    Code:
    p# lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 9.8 (stretch)
    Release:        9.8
    Codename:       stretch
    
    and I've the file 20-mbstring.ini in all directory I show you
    Code:
    root@vps1:/etc/php/7.2# cat cgi/conf.d/20-mbstring.ini
    ; configuration for php mbstring module
    ; priority=20
    extension=mbstring.so
    
    root@vps1:/etc/php/7.2# cat cli/conf.d/20-mbstring.ini
    ; configuration for php mbstring module
    ; priority=20
    extension=mbstring.so
    
    root@vps1:/etc/php/7.2# cat fpm/conf.d/20-mbstring.ini
    ; configuration for php mbstring module
    ; priority=20
    extension=mbstring.so
    
    root@vps1:/etc/php/7.2# cat mods-available/mbstring.ini
    ; configuration for php mbstring module
    ; priority=20
    extension=mbstring.so
    
     
  6. Davide Del Gatto

    Davide Del Gatto New Member

    I already restarted php7.2-fpm
     
  7. Davide Del Gatto

    Davide Del Gatto New Member

    I have a question...by default ISPconfig which version of PHP it uses?

    I don't know if this information is important
    Code:
    # update-alternatives --config php
    There are 3 choices for the alternative php (providing /usr/bin/php).
    
      Selection    Path             Priority   Status
    ------------------------------------------------------------
      0            /usr/bin/php7.3   73        auto mode
      1            /usr/bin/php7.0   70        manual mode
    * 2            /usr/bin/php7.2   72        manual mode
      3            /usr/bin/php7.3   73        manual mode
    
     
    Last edited: Mar 7, 2019
  8. Davide Del Gatto

    Davide Del Gatto New Member

    Just in case I uploaded my php.ini
     

    Attached Files:

  9. florian030

    florian030 Well-Known Member HowtoForge Supporter

    use 7.0 with stretch and install mb_string for 7.0
     
  10. Davide Del Gatto

    Davide Del Gatto New Member

    I can't BELIVE. Yesterday I closed the office too late and ISPconfig didn't work but now I'm in the office and ISPconfig working. How's possible I didn't change anything, the last night I restarted the server 3/4 times but nothing happened and then I didn't change the PHP Version

    Code:
    # date
    Thu Mar  7 10:11:11 GMT 2019
    root@vps1:/var/log/apache2# php -v
    PHP 7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0 (cli) (built: Feb  9 2019 06:51:24) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0, Copyright (c) 1999-2018, by Zend Technologies
    
    Any ideas? I would like to understand why it's happened.
     
  11. Davide Del Gatto

    Davide Del Gatto New Member

    I would like changing the thread's title in [SOLVED] does ISPconfig auto-fixed the issue? hahahahah not make sense
     
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    For threads that you have started yourself you can click on the topic and edit it to your liking.
    There is "Thread tools" button where you can choose "Edit title"
     
  13. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    One thought on this issue when 7.2 mbstring was installed but clearly not available in the ISPConfig vhost, I would guess that you had 7.2 as the default for cli php, but were using a different version for the web. You should install mbstring (and in general all other modules you use) for all php versions, and use 7.0 as the default version as @florian030 said. My guess as to why it started working is that you installed mbstring for 7.0 as instructed, and that was the php version your vhost is using.
     

Share This Page