[SOLVED] php8.1-fpm gives error says webXX.sock does not exist in multipe phps installation

Discussion in 'Installation/Configuration' started by zenny, Jan 27, 2022.

  1. zenny

    zenny Member

    Hi,

    I am on debian buster with multiple PHPs [5.6,7.3(default),and 8.1] installed as instructed in How to install PHP 5.6 and 7.0 - 8.1 as PHP-FPM & FastCGI for ISPConfig 3 with apt on Debian 8 to 11 (https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/).

    However, when I try to access a website, a critical error popped in the log (visually giving a blank page):
    Code:
    2022/01/27 10:02:09 [crit] 9410#9410: *10 connect() to unix:/var/lib/php8.1-fpm/web36.sock failed (2: No such file or directory)
    I have chosen PHP8.1 (see https://pasteall.org/pic/dc7a0f906a42462db6e4444aa10e3807 ), yet does not create the relevant socket.

    I have touched `/var/lib/php8.1-fpm/web36.sock` manually. but didn't work.

    Also created /var/lib/php8.1-fpm and changed file permission 755 (Ref. https://www.howtoforge.com/communit...ol-panel-gives-502-error-after-upgrade.88330/)

    Even after making changes above from the ISPConfig panel, the relevant nginx config reverts back to php5-fpm?!:
    Code:
            location ~ \.php$ {
                try_files /24b548f202361d0ca790386249f540b1.htm @php;
            }
    
            location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php5-fpm/web36.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
            location /cgi-bin/ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                root /var/www/clients/client4/web36;
                gzip off;
                fastcgi_pass  unix:/var/run/fcgiwrap.socket;
                fastcgi_index index.cgi;
                fastcgi_param DOCUMENT_ROOT /web;
                fastcgi_param HOME /web;
                fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    Manually changed ` fastcgi_pass unix:/var/lib/php5-fpm/web36.sock;` to `fastcgi_pass unix:/var/lib/php8.1-fpm/web36.sock;`, but it gets reverted back to php5-fpm again and again.

    Checked the attribution of the nginx-config file with `lsattr`, but it resulted ` --------------e---- /etc/nginx/sites-available/sitename.tld.vhost`. Thus immutability is not an issue neither!

    Any clue appreciated? Thanks!
     
    Last edited: Jan 27, 2022
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I would guess some settings in the additional php settings for the PHP 8.1 version in ISPConfig are wrong.
     
  3. zenny

    zenny Member

    Thanks @till

    I have set:
    Code:
    FastCGI settings
    Path to the PHP FastCGI binary: /usr/bin/php-cgi8.1
    Path to the php.ini directory: /etc/php/8.1/fpm
    Code:
    PHP-FPM settings
    Path to the PHP-FPM init script: /etc/init.d/php8.1-fpm
    Path to the php.ini directory: /etc/php/8.3/fpm
    Path to the PHP-FPM pool directory: /etc/php/8.1/fpm/pool.d
    PHP-FPM socket directory
    I have made changes to the /etc/php/8.1/fpm/php.ini in pursuant to https://www.howtoforge.com/perfect-server-debian-10-nginx-bind-dovecot-ispconfig-3.1/:

    Code:
    # diff /etc/php/8.1/fpm/php.ini /etc/php/8.1/cgi/php.ini
    802c802
    < cgi.fix_pathinfo=0
    ---
    > ;cgi.fix_pathinfo=1
    968c968
    < date.timezone = "Europe/Rome"
    ---
    > ;date.timezone =
    1895c1895
    < opcache.validate_root = 1
    ---
    > ;opcache.validate_root=0
    Appreciate if you can point out faulty paths in configuration. Thanks.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to change this to:

    Path to the PHP-FPM init script: php8.1-fpm

    and "PHP-FPM socket directory" should stay empty, this means that ISPConfig uses the central socket directory /var/lib/php5-fpm/ which is the default and recommended.

    Then go into the website settings, choose a different PHP version, press save, then go back to the settings, choose PHP 8.1 again and press save.
     
  5. zenny

    zenny Member

    Thanks again @till for prompt reply.

    Made changes as you instructed and the errors are gone, with web36 using php8.1-fpm:

    Code:
     php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
       Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor preset: ena
       Active: active (running) since Thu 2022-01-27 13:13:21 CET; 1min 18s ago
         Docs: man:php-fpm8.1(8)
      Process: 8308 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-
     Main PID: 8303 (php-fpm8.1)
       Status: "Processes active: 0, idle: 4, Requests: 0, slow: 0, Traffic: 0req/sec"
        Tasks: 5 (limit: 4664)
       Memory: 14.9M
       CGroup: /system.slice/php8.1-fpm.service
               ├─8303 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)
               ├─8304 php-fpm: pool web36
               ├─8305 php-fpm: pool web36
               ├─8306 php-fpm: pool www
               └─8307 php-fpm: pool www
    
    Jan 27 13:13:21 server3 systemd[1]: Starting The PHP 8.1 FastCGI Process Manager.
    Yet the webpage appears blank! Could not figure out any errors in both site log and global log! Any inputs!
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Add a simple php page with:

    Code:
    <?php
    phpinfo();
    inside, open the url to that page in the browser and check if you get phpinfo() output or not.
     
  7. zenny

    zenny Member

    Thanks again, I get the output of phpinfo().

    However, the issue was due to the third party trying to upgrade wordpress from 4 to 5 without upgrading the wordpress DB. The issue is resolved. Cheers,
     
    till likes this.
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You had this:
    Code:
    Path to the php.ini directory: /etc/php/8.3/fpm
    where the 8.3 probably is typo?
     
  9. zenny

    zenny Member

    I don't think so, because the file in /etc/php/8.3/fpm/php.ini and /etc/php8.3/cgi/php.ini are same except some changes required by ISPConfig which has been diffed in the post above https://www.howtoforge.com/communit...-multipe-phps-installation.88338/#post-431672. So I don't think it was a typo.

    @till If so, do one needs to change the php.ini inside cgi directory and point to that path? Appreciate your input.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess @Taleman refers to the 8.3 vs. 8.1. in the path, there is no PHP 8.3 yet as far as I know :)
     
  11. zenny

    zenny Member

    @till Thanks for the pointer. @Taleman That was obviously a typo. Thanks for pointing it out! Cheers,
     

Share This Page