PHP-FPM is not working

Discussion in 'Installation/Configuration' started by Observer_bald, Nov 10, 2020.

  1. Observer_bald

    Observer_bald New Member

    Hi,

    For some reason, PHP-FPM (on Apache2) is not working in a fresh ISPconfig 3.2 (stable version) installation on Debian 10. The browsers display me the php source code. If I select 'Fast-CGI' it works correctly.
    I have installed PHP 5.6, 7.0, 7.1, 7.2 and 7.4 from 'sury' repository.
    NOTE: The link of the article that I followed is in the attachment.

    I have attached to this post the output of certain commands and their results.

    About this last output, I don't know why but it listens on the default PHP version (/var/lib/php7.3-fpm/web1.sock).

    Can anybody help/guide me to fix this issue?

    Thank you.
     

    Attached Files:

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not see from the path which PHP version it listens on. The number 7.3 in the path is no indication for the PHP version, it's just the name of the directory which contains all PHP-FPM socket files of the system. The PHP-FPM version on that socket is PHP 5.6 at the moment.

    Switch the PHP to php-fpm, wait until the red dot stops flashing in the ispconfig navigation bar, put a php file with phpinfo() extension into the web directory of the site and try to open it in the browser.
     
    Observer_bald likes this.
  3. Observer_bald

    Observer_bald New Member

     
  4. Observer_bald

    Observer_bald New Member

    Ups...

    The browser displays the code itself, it is not interpreting it:
    Code:
    <?php
      phpinfo();
    ?>
    Thank you for your time Till.
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Run through the perfect server guide again and ensure you have all the needed apache modules installed/enabled.
     
    Observer_bald likes this.
  6. Observer_bald

    Observer_bald New Member

    Hi,

    You're right Jesse Norell, after checking the documentation I found out that the package 'proxy_fcgi' wasn't installed, my fault, I'm sorry. After installing this package PHP-FPM can interpret the PHP code correctly.

    I did a few tests and I found out that the switch between PHP versions is not working correctly, similar issue as this post.

    Basically, the version remains after the changes were applied (the configuration file 'web1.conf' is changed to the right PHP version). If I tried to restart the PHP daemon of the version that I want to use (let's say, PHP7.0), I get the following error:

    Code:
    [10-Nov-2020 21:10:14] NOTICE: reloading: execvp("/usr/sbin/php-fpm7.0", {"/usr/sbin/php-fpm7.0", "--nodaemonize", "--fpm-config", "/etc/php/7.0/fpm/php-fpm.conf"})
    [10-Nov-2020 21:10:14] NOTICE: using inherited socket fd=7, "/run/php/php7.0-fpm.sock"
    [10-Nov-2020 21:10:14] NOTICE: using inherited socket fd=7, "/run/php/php7.0-fpm.sock"
    [10-Nov-2020 21:10:14] ERROR: An another FPM instance seems to already listen on /var/lib/php7.3-fpm/web1.sock
    [10-Nov-2020 21:10:14] ERROR: An another FPM instance seems to already listen on /var/lib/php7.3-fpm/web1.sock
    [10-Nov-2020 21:10:14] ERROR: FPM initialization failed
    [10-Nov-2020 21:10:14] ERROR: FPM initialization failed
    
    To make it work, I have to reload the 'old' PHP version that was set and then, restart the 'new' PHP version, below an example:

    Code:
    ## 'Old' PHP version
    systemctl reload php7.4-fpm
    
    ## 'New' PHP version that I want to use
    systemctl restart php7.0-fpm
    
    Finally, I tried to run the script '/usr/local/ispconfig/server/server.sh' and it didn't display any error or warning.

    Thank you again.
     

Share This Page