HOWTO Install PHP 7.1, 7.2 and 5.6 as PHP-FPM & FastCGI for ISPConfig 3 on Debian 9

Discussion in 'Installation/Configuration' started by tanaka141, Nov 22, 2019.

  1. tanaka141

    tanaka141 New Member

    Hi all,
    I wrote this thread because i have a big problem at this moment. My ISPConfig have a job queue of 63 tasks to do, but it is freezed for 3 days ATM.

    I used the HOWTO : (https://www.howtoforge.com/tutorial/how-to-install-php-5.6-and-7.1-on-debian-9-stretch/) and followed all tasks to have PHP 7.3 available for 2 sites i had in my own (not professionnal sites).

    Theses errors are showed at the begin of the log when i start the command :
    /usr/local/ispconfig/server/server.sh
    I have also stopped ./server in the crontab.

    The log is :
    22.11.2019-12:01 - WARNING - There is already a lockfile set, but no process running with this pid (17678). Continuing.


    PHP Fatal error: Uncaught Error: Call to undefined function mb_detect_encoding() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:523
    Stack trace:
    #0 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(183): db->escape('%:/opt/php-7.2/...')
    #1 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(301): db->_build_query_string('SELECT * FROM w...', '%:/opt/php-7.2/...')
    #2 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(340): db->_query('SELECT * FROM w...', '%:/opt/php-7.2/...')
    #3 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(389): db->query('SELECT * FROM w...', '%:/opt/php-7.2/...')
    #4 /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php(194): db->queryAllRecords('SELECT * FROM w...', '%:/opt/php-7.2/...')
    #5 /usr/local/ispconfig/server/lib/classes/plugins.inc.php(156): apache2_plugin->php_ini_changed('php_ini_changed', Array)
    #6 /usr/local/ispconfig/server/plugins-available/webserver_plugin.inc.php(154): plugins->raiseAction('php_ini_changed', Array)
    #7 /usr/local/isp in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 523

    I think there is something in mb_detect_encoding(), but i can't find any solutions.

    I have done also the "htf_report.txt", but i think this is only usefull to correct the errors for next :
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 9.11 (stretch)

    [INFO] ISPConfig is installed.

    ##### ISPCONFIG #####
    ISPConfig version is 3.1.15p2


    ##### VERSION CHECK #####

    [INFO] php (cli) version is 7.2.24-1+0~20191026.31+debian9~1.gbpbbacde

    ##### PORT CHECK #####


    ##### MAIL SERVER CHECK #####


    ##### RUNNING SERVER PROCESSES #####

    [INFO] I found the following web server(s):
    Apache 2 (PID 989)
    [INFO] I found the following mail server(s):
    Postfix (PID 1091)
    [INFO] I found the following pop3 server(s):
    Dovecot (PID 481)
    [INFO] I found the following imap server(s):
    Dovecot (PID 481)
    [INFO] I found the following ftp server(s):
    PureFTP (PID 1214)

    ##### LISTENING PORTS #####
    (only ()
    Local (Address)
    [anywhere]:21 (1214/pure-ftpd)
    ***.***.***.***:53 (416/named)
    [localhost]:53 (416/named)
    [anywhere]:22 (504/sshd)
    [anywhere]:25 (1091/master)
    [localhost]:953 (416/named)
    [anywhere]:993 (481/dovecot)
    [anywhere]:995 (481/dovecot)
    [localhost]:8998 (415/php-fpm:)
    [localhost]:10023 (680/postgrey)
    [localhost]:10024 (1256/amavisd-new)
    [localhost]:10025 (1091/master)
    [localhost]:10026 (1256/amavisd-new)
    [localhost]:10027 (1091/master)
    [anywhere]:587 (1091/master)
    [localhost]:11211 (424/memcached)
    [anywhere]:110 (481/dovecot)
    [anywhere]:143 (481/dovecot)
    [anywhere]:465 (1091/master)
    *:*:*:*::*:21 (1214/pure-ftpd)
    *:*:*:*::*:53 (416/named)
    *:*:*:*::*:22 (504/sshd)
    *:*:*:*::*:25 (1091/master)
    *:*:*:*::*:953 (416/named)
    *:*:*:*::*:443 (989/apache2)
    *:*:*:*::*:993 (481/dovecot)
    *:*:*:*::*:995 (481/dovecot)
    *:*:*:*::*:10023 (680/postgrey)
    *:*:*:*::*:10024 (1256/amavisd-new)
    *:*:*:*::*:10026 (1256/amavisd-new)
    *:*:*:*::*:3306 (626/mysqld)
    *:*:*:*::*:587 (1091/master)
    [localhost]10 (481/dovecot)
    [localhost]43 (481/dovecot)
    *:*:*:*::*:80 (989/apache2)
    *:*:*:*::*:8080 (989/apache2)
    *:*:*:*::*:465 (1091/master)
    *:*:*:*::*:8081 (989/apache2)




    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    f2b-postfix-sasl tcp -- [anywhere]/0 [anywhere]/0 multiport dports 25
    f2b-dovecot tcp -- [anywhere]/0 [anywhere]/0 multiport dports 110,995,143,993,587,465,4190
    f2b-pure-ftpd tcp -- [anywhere]/0 [anywhere]/0 multiport dports 21
    f2b-sshd tcp -- [anywhere]/0 [anywhere]/0 multiport dports 22

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Chain f2b-dovecot (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    Chain f2b-postfix-sasl (1 references)
    target prot opt source destination
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    RETURN all -- [anywhere]/0 [anywhere]/0

    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
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    REJECT all -- ***.***.***.*** [anywhere]/0 reject-with icmp-port-unreachable
    RETURN all -- [anywhere]/0 [anywhere]/0
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if you accidentially replaced the main PHP version of your operating system with an additional PHP version that you compiled in /opt/ folder and thats the reasonfor your problem. Please run the command:

    which php

    and post the result.
     
  3. tanaka141

    tanaka141 New Member

    Arghhh !
    I did something but only installing by the apt-get system, with command
    apt install php7.2 php7.2-common php7.2-cli php7.2-mysql php7.2-xml php7.2-curl
    then i think i must remove it, and use php7.0....................................

    /usr/bin/php

    Till
    Good job for all you made in ISPConfig
     
  4. tanaka141

    tanaka141 New Member

    the result with : php -v

    is :

    PHP 7.2.24-1+0~20191026.31+debian9~1.gbpbbacde (cli) (built: Oct 26 2019 14:18:28) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-1+0~20191026.31+debian9~1.gbpbbacde, Copyright (c) 1999-2018, by Zend Technologies
     
  5. tanaka141

    tanaka141 New Member

    then, when i move backward to the PHP7.0 the server
    All return to the normal status, grrrrr

    TILL,
    TY for all you do here

    I am under the ground (en français, je suis une grosse merde)
     
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  7. tanaka141

    tanaka141 New Member

    TY,
    I had just removed the PHP7.2, and the system turn with PHP7.0

    All things returning normal

    This thread can be closed, if this is possible
     
  8. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  9. M Javier

    M Javier New Member HowtoForge Supporter

    Hello,
    I follow the guide, I read carefully, and I did this on debian 10. Buster installs php7.3 stable, I name the PHP-7.3 as described, but with the actual path's installed and named (differs from the guide) then I enable the sury repository, install the other versions that I needed, but avoid installing the one debian 10 install, even that it was marked to upgrade by sury repo (because is the one ISPconfig used at install). Then I disable the sury repository and my monitor status return to green. test phpinfo() on the websites with diferent php versions, and everything goes fine. I am newbie and I don't like warnings so I'm far away to consider my Perfect server perfect, not because of ISPconfig, but for me.
    Best regards
     
  10. Steini86

    Steini86 Active Member

    Then you will not get (security) updates for PHP7.3+. You should reenable the repo! It is safe to upgrade all packages from the sury repo.
     
    elmacus likes this.
  11. M Javier

    M Javier New Member HowtoForge Supporter

    Hi,
    But I get them from debian. I will re-enable sury to update the other's php version if any, but my goal is to upgrade applications to use php7.3 as php5.6 or php7.0 are no longer manteined, or sury give security updates to php5.6 or php7.0?
    Regards,
     
  12. Steini86

    Steini86 Active Member

    The maintainer of the sury repository is the same than the maintainer of the debian php repository. They are compatible. The sury repo is just newer. Security updates should go to both, the debian repo and the sury repo. Feature upgrades go only to the sury repos.
     
    M Javier likes this.
  13. M Javier

    M Javier New Member HowtoForge Supporter

    ok. thank you.
    Regards,
     
  14. tanaka141

    tanaka141 New Member

    Hi all,

    It's me again :)

    i have now a new problem.

    2 of my web site suffer from this error :
    Code:
    [Mon Dec 30 16:35:50.178889 2019] [proxy:error] [pid 8785] (111)Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web5.sock (*) failed
    [Mon Dec 30 16:35:50.178976 2019] [proxy_fcgi:error] [pid 8785] [client ***.***.***.***:3718] AH01079: failed to make connection to backend: httpd-UDS
    Code:
    [Mon Dec 30 16:17:09.298440 2019] [proxy:error] [pid 5725] (111)Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web6.sock (*) failed
    [Mon Dec 30 16:17:09.298521 2019] [proxy_fcgi:error] [pid 5725] [client ***.***.***.***:7202] AH01079: failed to make connection to backend: httpd-UDS
    /var/lib/php7.0-fpm/web6.sock and /var/lib/php7.0-fpm/web5.sock doen't exists because /var/lib/php7.0-fpm/ doesn't exit. I have only the /var/lib/php7.2-fpm/ directory, which is used by my web9 which is fully operationnal...
    here my htf_report.txt :
    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 9.11 (stretch)
     
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.1.15p2
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 7.0.33-14+0~20191218.25+debian9~1.gbpae1889
    
    ##### PORT CHECK #####
    
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
        Apache 2 (PID 8744)
    [INFO] I found the following mail server(s):
        Postfix (PID 1091)
    [INFO] I found the following pop3 server(s):
        Dovecot (PID 481)
    [INFO] I found the following imap server(s):
        Dovecot (PID 481)
    [INFO] I found the following ftp server(s):
        PureFTP (PID 5563)
    
    ##### LISTENING PORTS #####
    (only        ()
    Local        (Address)
    [anywhere]:21        (5563/pure-ftpd)
    [anywhere]:5269        (7129/lua5.1)
    ***.***.***.***:53        (416/named)
    [localhost]:53        (416/named)
    [anywhere]:22        (504/sshd)
    [anywhere]:25        (1091/master)
    [localhost]:953        (416/named)
    [anywhere]:993        (481/dovecot)
    [anywhere]:995        (481/dovecot)
    [anywhere]:5222        (7129/lua5.1)
    [localhost]:8998        (415/php-fpm:)
    [localhost]:10023        (680/postgrey)
    [localhost]:10024        (1256/amavisd-new)
    [localhost]:10025        (1091/master)
    [anywhere]:5290        (7129/lua5.1)
    [localhost]:10026        (1256/amavisd-new)
    [anywhere]:5291        (7129/lua5.1)
    [localhost]:10027        (1091/master)
    [anywhere]:587        (1091/master)
    [localhost]:11211        (424/memcached)
    [localhost]:5582        (7129/lua5.1)
    [anywhere]:110        (481/dovecot)
    [anywhere]:143        (481/dovecot)
    [anywhere]:465        (1091/master)
    *:*:*:*::*:21        (5563/pure-ftpd)
    *:*:*:*::*:53        (416/named)
    *:*:*:*::*:22        (504/sshd)
    *:*:*:*::*:25        (1091/master)
    *:*:*:*::*:953        (416/named)
    *:*:*:*::*:443        (8744/apache2)
    *:*:*:*::*:993        (481/dovecot)
    *:*:*:*::*:995        (481/dovecot)
    *:*:*:*::*:10023        (680/postgrey)
    *:*:*:*::*:10024        (1256/amavisd-new)
    *:*:*:*::*:10026        (1256/amavisd-new)
    *:*:*:*::*:3306        (626/mysqld)
    *:*:*:*::*:587        (1091/master)
    [localhost]10        (481/dovecot)
    [localhost]43        (481/dovecot)
    *:*:*:*::*:80        (8744/apache2)
    *:*:*:*::*:8080        (8744/apache2)
    *:*:*:*::*:465        (1091/master)
    *:*:*:*::*:8081        (8744/apache2)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    f2b-postfix-sasl  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 25
    f2b-dovecot  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 110,995,143,993,587,465,4190
    f2b-pure-ftpd  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 21
    f2b-sshd   tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 22
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain f2b-dovecot (1 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-postfix-sasl (1 references)
    target     prot opt source               destination         
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***      [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***         [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***         [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    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         
    REJECT     all  --  ***.***.***.***      [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***         [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***      [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    This means that you used a nonexisting path in your server settings. Ensure that you use an existing path for the socket dir under System > server config.
     
  16. tanaka141

    tanaka141 New Member

    Socket dir is defined by "/var/lib/php7.0-fpm" and i found in all the web*.sock (9, 6 and 5).
    Owners are web*:www-data
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so the folder does exist? One post above you claimed that there is no folder /var/lib/php7.0-fpm. The folder that you set in the config must exist, if it does not exist, php-fpm can not work.
     
  18. tanaka141

    tanaka141 New Member

    Excuse me, i read an another post, and make the mistake between the 2 directory (/opt/php/7.x), where i have only the "7.2".

    Then, after reading yours reponse, i confirm :
    Code:
    [Mon Dec 30 16:17:09.298440 2019] [proxy:error] [pid 5725] (111)Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web6.sock (*) failed
    Code:
    [Mon Dec 30 16:35:50.178889 2019] [proxy:error] [pid 8785] (111)Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web5.sock (*) failed
    Code:
    Socket dir is defined by "/var/lib/php7.0-fpm" 
    need to reread, what i post before...
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    The name of the directory does not matter, it just has to exit. So either you create the missing directory or you change the settings. then Go to Tools > resync, select websites and start the resync to create the sockets that are missing due to the missing directory. And just to make this clear, ALL sockets are in this directory, no matter which PHP version the site uses and the name of the directory is NO indication for the sued PHP version.
     
  20. tanaka141

    tanaka141 New Member

    i did a resync for my server, and 3 websites.

    Same error for 2 websites (which are with the default php) and the last, fully fonctionnal with php-7.2
     

Share This Page