PHP-FPM 7.0 Debian 9 - not working

Discussion in 'Server Operation' started by toffie, Apr 20, 2019.

  1. toffie

    toffie New Member

    Hey everyone,

    I've searched around and I can't find anything helpful on the net regarding this issue, so therefore I'm looking for help here - as I've followed a Perfect Server tutorial for Debian 9.

    When trying any PHP page, on any of my Debian 9 machines while having PHP-FPM configured, I get a "Error 503 - Service Unavailable" message. Changing PHP variant to Fast-CGI it runs perfectly. I can have as little as <? ?> in the PHP file and still get the error for PHP-FPM.

    I read somewhere on this forum that PHP 7.1 wasn't compatible with ISPConfig, but could be run on websites and so on. So I just tried php --version to see what version I have and this is the output;

    Code:
    [email protected]:~# php --version
    PHP 7.0.33-0+deb9u3 (cli) (built: Mar  8 2019 10:01:24) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.0.33-0+deb9u3, Copyright (c) 1999-2017, by Zend Technologies
    
    Debian version;
    Code:
    [email protected]:~# lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 9.8 (stretch)
    Release:        9.8
    Codename:       stretch
    
    Not really sure if ISPConfig version matters but I'm running 3.1.11

    Only thing I get in the error log is the following, but I don't know if this is related to this error - probably is, but I can't figure out what is wrong.
    [ 2019-04-20 10:32:59.7571 26334/7f295bfa2700 age/Cor/CoreMain.cpp:532 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2019-04-20 10:32:59.7572 26334/7f29627cd600 age/Cor/CoreMain.cpp:901 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2019-04-20 10:32:59.7572 26339/7fc0e8970700 age/Ust/UstRouterMain.cpp:422 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2019-04-20 10:32:59.7573 26339/7fc0eefc0600 age/Ust/UstRouterMain.cpp:492 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2019-04-20 10:32:59.7583 26339/7fc0e3fff700 Ser/Server.h:817 ]: [UstRouterApiServer] Freed 0 spare client objects
    [ 2019-04-20 10:32:59.7583 26339/7fc0e3fff700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
    [ 2019-04-20 10:32:59.7586 26334/7f295b7a1700 Ser/Server.h:817 ]: [ApiServer] Freed 0 spare client objects
    [ 2019-04-20 10:32:59.7586 26334/7f295b7a1700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
    [ 2019-04-20 10:32:59.7587 26334/7f295bfa2700 Ser/Server.h:817 ]: [ServerThr.1] Freed 128 spare client objects
    [ 2019-04-20 10:32:59.7587 26334/7f295bfa2700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
    [ 2019-04-20 10:32:59.7590 26339/7fc0e8970700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
    [ 2019-04-20 10:32:59.7591 26339/7fc0eefc0600 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
    [ 2019-04-20 10:32:59.7826 26334/7f29627cd600 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
    [Sat Apr 20 10:32:59.962102 2019] [mpm_prefork:notice] [pid 26321] AH00169: caught SIGTERM, shutting down
    [ 2019-04-20 10:33:00.1841 26800/7f4c23a25600 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
    [ 2019-04-20 10:33:00.1920 26803/7f594d66d600 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
    [ 2019-04-20 10:33:00.1920 26803/7f594d66d600 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
    [ 2019-04-20 10:33:00.1929 26803/7f594d66d600 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 26803
    [ 2019-04-20 10:33:00.2012 26808/7fc027a4d600 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
    [ 2019-04-20 10:33:00.2018 26808/7fc027a4d600 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 26808
    [Sat Apr 20 10:33:00.388953 2019] [ssl:warn] [pid 26798] AH01906: whc-001.wisehouse.se:8080:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
    [Sat Apr 20 10:33:00.389198 2019] [ssl:error] [pid 26798] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=whc-001.wisehouse.se,OU=Wise House,O=Wise House,L=Stockholm,ST=Stockholm,C=SE / issuer: CN=whc-001.wisehouse.se,OU=Wise House,O=Wise House,L=Stockholm,ST=Stockholm,C=SE / serial: B20A06A9302F0BBD / notbefore: Mar 26 09:47:39 2019 GMT / notafter: Mar 23 09:47:39 2029 GMT]
    [Sat Apr 20 10:33:00.389217 2019] [ssl:error] [pid 26798] AH02604: Unable to configure certificate whc-001.wisehouse.se:8080:0 for stapling
    [Sat Apr 20 10:33:00.389255 2019] [suexec:notice] [pid 26798] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)

    [ 2019-04-20 10:33:00.3954 26803/7f5946e42700 age/Cor/CoreMain.cpp:532 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2019-04-20 10:33:00.3954 26803/7f594d66d600 age/Cor/CoreMain.cpp:901 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2019-04-20 10:33:00.3954 26803/7f5946641700 Ser/Server.h:817 ]: [ApiServer] Freed 0 spare client objects
    [ 2019-04-20 10:33:00.3954 26803/7f5946641700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
    [ 2019-04-20 10:33:00.3955 26803/7f5946e42700 Ser/Server.h:817 ]: [ServerThr.1] Freed 128 spare client objects
    [ 2019-04-20 10:33:00.3955 26803/7f5946e42700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished

    [ 2019-04-20 10:33:00.3960 26808/7fc0213fd700 age/Ust/UstRouterMain.cpp:422 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2019-04-20 10:33:00.3960 26808/7fc027a4d600 age/Ust/UstRouterMain.cpp:492 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2019-04-20 10:33:00.3961 26808/7fc020bfc700 Ser/Server.h:817 ]: [UstRouterApiServer] Freed 0 spare client objects
    [ 2019-04-20 10:33:00.3961 26808/7fc020bfc700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
    [ 2019-04-20 10:33:00.3962 26808/7fc0213fd700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
    [ 2019-04-20 10:33:00.3963 26808/7fc027a4d600 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
    [ 2019-04-20 10:33:00.4162 26803/7f594d66d600 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
    [ 2019-04-20 10:33:00.4515 26829/7faaee8a0600 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
    [ 2019-04-20 10:33:00.4716 26834/7f8f16368600 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
    [ 2019-04-20 10:33:00.4717 26834/7f8f16368600 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
    [ 2019-04-20 10:33:00.4724 26834/7f8f16368600 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 26834
    [ 2019-04-20 10:33:00.4944 26839/7ff77fe28600 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
    [ 2019-04-20 10:33:00.4949 26839/7ff77fe28600 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 26839
    [Sat Apr 20 10:33:00.558218 2019] [:error] [pid 26824] python_init: Python version mismatch, expected '2.7.5+', found '2.7.13'.
    [Sat Apr 20 10:33:00.595052 2019] [:error] [pid 26824] python_init: Python executable found '/usr/bin/python'.
    [Sat Apr 20 10:33:00.595084 2019] [:error] [pid 26824] python_init: Python path being used '/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
    [Sat Apr 20 10:33:00.595109 2019] [:notice] [pid 26824] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
    [Sat Apr 20 10:33:00.595113 2019] [:notice] [pid 26824] mod_python: using mutex_directory /tmp
    [Sat Apr 20 10:33:01.008185 2019] [ssl:warn] [pid 26824] AH01906: whc-001.wisehouse.se:8080:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
    [Sat Apr 20 10:33:01.008337 2019] [ssl:error] [pid 26824] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=whc-001.wisehouse.se,OU=Wise House,O=Wise House,L=Stockholm,ST=Stockholm,C=SE / issuer: CN=whc-001.wisehouse.se,OU=Wise House,O=Wise House,L=Stockholm,ST=Stockholm,C=SE / serial: B20A06A9302F0BBD / notbefore: Mar 26 09:47:39 2019 GMT / notafter: Mar 23 09:47:39 2029 GMT]
    [Sat Apr 20 10:33:01.008346 2019] [ssl:error] [pid 26824] AH02604: Unable to configure certificate whc-001.wisehouse.se:8080:0 for stapling
    [Sat Apr 20 10:33:01.013271 2019] [mpm_prefork:notice] [pid 26824] AH00163: Apache/2.4.25 (Debian) mod_fcgid/2.3.9 Phusion_Passenger/5.0.30 mod_python/3.3.1 Python/2.7.13 OpenSSL/1.0.2r configured -- resuming normal operations
    [Sat Apr 20 10:33:01.013292 2019] [core:notice] [pid 26824] AH00094: Command line: '/usr/sbin/apache2'


    Any ideas? Let me know what else you need me to provide to find the cause of the error.

    Many thanks in advance guys!!
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You posted in Linux forum, but seem you are running ISPConfig?
    ISPConfig supports the PHP version that comes with the operating system. So for Debian 9.x it is PHP 7.0. Other PHP versions are not supported (for ISPConfig) on Debian 9.
    You can install additional PHP versions for websites, but must set the Default PHP version back to the original (see Tutorial: https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/)
    Furthermore, PHP version may be different for command line applications and web applications. You checked command line version is 7.0, but check also web version.
    Then check you have installed the PHP modules required in the Perfect Server Guide and that the configurations match what that Guide says.
     
  3. toffie

    toffie New Member

    Of course I'm posting in the Linux forum as ISPConfig runs on Linux and as I have problems with PHP and not directly ISPConfig - I see no other possible forum part to post in.

    Sure I'm talking about ISPConfig as I use that to configure which PHP version the sites are using. But I don't really see that ISPConfig should be at fault - I guess and hope not, doesn't feel like it.

    As I've followed a Perfect Server for Debian 9 guide, on Howtoforge I believe I can't do it wrong. Hence the reason I've followed these guides for so many years now.
    https://www.howtoforge.com/tutorial...-stretch-apache-bind-dovecot-ispconfig-3-1/2/

    Of course, installing PHP 7 is a nobrainer as it says in the guide.
    Code:
    apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-imap phpmyadmin php7.0-cli php7.0-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php7.0-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl memcached php-memcache php-imagick php-gettext php7.0-zip php7.0-mbstring memcached libapache2-mod-passenger php7.0-soap
    Also, PHP 7 FPM module is installed and activated with Apache2
    Code:
    apt-get -y install php7.0-fpm
    a2enmod actions proxy_fcgi alias
    service apache2 restart
    So I can't really see that I've done anything wrong as I've followed the guide on every single command - and I've installed 60+ servers with Debian 8 (with and without ISPConfig) without problems and 4-5 servers with Debian 9 and none of them can use PHP-FPM - when chosen in ISPConfig administration for sites on that server.

    However, if I choose for example the PHP Fast-CGI module, the sites run perfectly. Sure, one could say - accept that and run with it.. But no, I don't care which PHP version/module I'm running - any of them should work no matter which I choose and as I've previously used PHP-FPM as recommended in Perfect Server tutorials, I feel that I should be able to use it in Debian 9 - especially as the tutorial tells me to install it.

    I have no problems with the ISPConfig administration, that works perfectly. It is only the sites that I pick PHP-FPM for that does not work and I get a 503 Service Unavailable message for.
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You seem to have done PHP as it should, so I can only suggest the configuration for PHP-FPM is wrong for the additional PHP-versions.
    How did you install the additional PHP versions? Self compiled or?
     
  5. toffie

    toffie New Member

    I certainly hope so :) Well, I have only installed PHP-FPM as far as I know and that is following the tutorial. All the other installed PHP versions are coming from the tutorial command;
    Code:
    apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-imap phpmyadmin php7.0-cli php7.0-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php7.0-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl memcached php-memcache php-imagick php-gettext php7.0-zip php7.0-mbstring memcached libapache2-mod-passenger php7.0-soap
    I have not installed anything else other than what the tutorial says.

    As far as I know, well, it is a pure Howtoforge Perfect Server Debian 9 installation with ISPConfig installed and configured - so a full tutorial run through and then setting up the first site in ISPConfig, choose PHP-FPM on site creation page and then I get the error - on that new site, not in ISPConfig.

    At first, I tried to troubleshoot the errors, but found that it wasn't something really simple so I skipped it, but now when installing my 5th machine I'm getting kind of irritated - certainly not on you guys, so please don't take it like that! But irritated that "simple" programs that previously just work, doesn't in the new version. Fine, I know - bugs exists, but I've had this problem for a few months now - so I guess such a bug should have been resolved, or at least the tutorial should say something or well - anyone reporting something similar.

    I hope this is just a simple "me" thing that we can find the cause for, otherwise why aren't more people reporting on this? :)

    I'm searching, searching, searching - trying to find a solution but I just hit several dead ends after each other. It can't be impossible and I hope we can solve this. Turns out that some of our new hardware isn't even compatible with Debian 8 for some strange reason - so I'm pretty much forced to use Debian 9..

    I really hope you can help me out :)
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If you installed additional PHP versions, you must install all the necessary PHP modules for all the installed versions. So if you have installed for example php7.0-mcrypt, you must also install php7.1-mcrypt, php7.2-mcrypt etc. If those are missing, the websites using additional PHP versions will not work.
    Note that some packages are removed from later PHP distributions, and some may have a different name. But the Tutorial should have the necessary info up to version PHP 7.3.
     

Share This Page