FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web2.sock (*) failed

Discussion in 'Installation/Configuration' started by kmchen, Oct 10, 2018.

  1. kmchen

    kmchen Member

    HI,
    I reinstalled completely a Debian 9/ispconfig 3 OVH server yesterday.
    Added 2 additinal php versions: php-fpm php5.6 and php 7.1.
    Assigned php5.6 to a vhost. But when I acces to it I get that in logs:


    Here is the ispconfig test output:
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    How did you install the php 5.6?
     
  3. kmchen

    kmchen Member

    Following that tuto https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/:
    And then in ispconfig:
     
    Last edited: Oct 10, 2018
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the file /opt/php-5.6/etc/php-fpm.conf if you added the include line at the end of the file as shown in the tutorial.
     
  5. kmchen

    kmchen Member

    If you mean that line
    include=/opt/php-5.6/etc/php-fpm.d/*.conf

    Yes it was yet in /opt/php-5.6/etc/php-fpm.conf. I have put it at end but no effect.
     
    Last edited: Oct 12, 2018
  6. kmchen

    kmchen Member

    Does that answer to your question ?
    Code:
    root@ns1:~# grep include /opt/php-5.6/etc/php-fpm.conf
    ; Include one or more files. If glob(3) exists, it is used to include a bunch of
    ;include=etc/fpm.d/*.conf
    ;include=/opt/php-5.6/etc/php-fpm.d/*.conf
    include=/opt/php-5.6/etc/php-fpm.d/*.conf
    
    Please help. I need to get through that install now
     
    Last edited: Oct 12, 2018
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Is the FPM pool file for the website were you activated PHP 5.6 in the folder /opt/php-5.6/etc/php-fpm.d ?
     
  8. kmchen

    kmchen Member

    /opt/php-5.6/etc/php-fpm.d doesn't exists:
    Code:
    root@ns1:~# ll /opt/php-5.6/etc
    total 76
    -rw-r--r-- 1 root root  1211 Oct  9 11:12 pear.conf
    -rw-r--r-- 1 root root 22873 Oct 11 07:44 php-fpm.conf
    -rw-r--r-- 1 root root 22788 Oct  9 11:11 php-fpm.conf.default
    -rw-r--r-- 1 root root 22796 Oct  9 23:18 php-fpm.conf.save
    What is "the FPM pool file for the website w(h?)ere you activated PHP 5.6" ?
     
  9. kmchen

    kmchen Member

    what is the use of php-fpm.conf and why is it listening on a port instead of unix sock ?
    I used to configure the fpm pool.d for each domain like that:
    Code:
    [webologix.com]
    user = web3
    group = client1
    listen = /var/run/php5-fpm-webologix.com.sock
    listen.owner = www-data
    listen.group = www-data
    
    pm = ondemand
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 2
    pm.max_spare_servers = 4
    
    request_terminate_timeout = 1800
    php_value[max_execution_time] = 1800
    
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Create that folder, then switch the website to default php mode, save, then back to php 5.6 and check if it works then.
     
  11. kmchen

    kmchen Member

    Hurray ! That worked ! Thaks Till.

    I guess I have to do that for all websites.

    Do you have an idea why that fpm.d/ and conf files were not created properly

    Now about the sockets. Is it possible to use a .sock instead listening on a port ?
     
    Last edited: Oct 12, 2018
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Sure, you can change that. But that's not used by your sites anyway, so I won't change it.
     
  13. kmchen

    kmchen Member

    All php-fpm websites can't connect to mysql but default php websites do, with same credentials.

    And nothing appears in logs
    I changed php5.6-fpm like this:
    Code:
    root@ns1:/var/www/webologix.com/web# grep log_level /opt/php-5.6/etc/php-fpm.conf
    log_level = debug
    root@ns1:/var/www/webologix.com/web# grep error.log /opt/php-5.6/etc/php-fpm.d/web2.conf
    php_admin_value[error_log] = /var/log/ispconfig/httpd/joomla-development.eu/error.log
    
    Is it correct ?
     
    Last edited: Oct 12, 2018
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    The conf files cannot be created when the folder where they shall be stored is missing.

    Wheny mysql is not working, then you might not have mysql compiled in. Create a php.info file to check if the mysql extension has been compiled into the PHP 5.6 binary.
     
  15. kmchen

    kmchen Member

  16. kmchen

    kmchen Member

    It appears that mysql support was not compiled so added --with-mysql in the configure like that :
    And redo the whole tutorial process. Now the phpinfo shows --with-mysql but still can't connect DB:
    Code:
    root@ns1:~# php -q /var/www/webologix.com/web/test.php
    PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /var/www/clients
     
    Last edited: Oct 13, 2018
  17. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are you running that test with PHP version 7? Try it with the php 5.6 you compiled.
     
  18. kmchen

    kmchen Member

    OK it works now. Thanks for your help
     
    Last edited: Oct 14, 2018
  19. Sotmlac

    Sotmlac New Member

    In my case when changing PHP version example to PHP7.4 for a specific website in Ispconfig 3.2.2 the webxx.conf file should have been created in /etc/php/7.4/fpm/pool.d/ but instead, it was created at root /.

    So for now I just mv the webxx.conf file to /etc/php/7.4/fpm/pool.d/ and restart PHP7.4-fpm sudo systemctl restart php7.4-fpm and it works correctly.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you must have set a wrong path in the ispconfig PHP srttings.
     
    Sotmlac likes this.

Share This Page