[SOLVED]Error in executing php-fpm on buildt php-5.6 on debian 9

Discussion in 'ISPConfig 3 Priority Support' started by StefanoBertoli, May 18, 2018.

  1. This is error
    [Thu May 17 23:30:54.290846 2018] [proxy:error] [pid 8941] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web6.sock (*) failed
    [Thu May 17 23:30:54.290914 2018] [proxy_fcgi:error] [pid 8941] [client 94.102.133.86:53401] AH01079: failed to make connection to backend: httpd-UDS

    Any idea?
     
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    Might be a mix up where fpm-config for the wrong php version (doesn't) exist.
    Set fastcgi or other php mode, check for remaining config in fpm pool.d and delete it if it exists.
    restart your fpm daemons and enable php-fpm for that web again. It should work, even if you switch versions.
    If not, check your setup - like did you really change the default www.conf listening port for the new php-version...
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Run this command and post the output:

    /opt/php-5.6/bin/php --version
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    And did you try to use the fastcgi mode instead of fpm mode, does it work?
     
  5. That output give me what I'm expecting:
    Code:
    PHP 5.6.36 (cli) (built: Apr 27 2018 10:24:12)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    I confirm it work with fast-cgi but would be great if it work with both.

    I also suggest to put in the Howtoforge guide the --with-gd parameter, it's really needed and I had to recompile php.
    Optional --with-mysql=shared would also be great for those who need to port old webs.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, fine. Then you should check that the port that you've set in /opt/php-5.6/etc/php-fpm.conf is really not in use yet. e.g. with:

    netstat -ntap | grep 8997

    if it's in use, then choose a different unused port there.
     
  7. netstat output is empty. No output. and the port is the same as the configured one.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to start the fpm daemon using systemctl command.
     
  9. Done
    Code:
    Enable the service and reload systemd:
    
    systemctl enable php-5.6-fpm.service
    systemctl daemon-reload
    
    Finally, start PHP-FPM.
    
    systemctl start php-5.6-fpm.service
    netstat didn't output anything

    if I execute the netstat command on the 8998 port (is the port for php 7.2) it return
    Code:
    tcp        0      0 127.0.0.1:8998          0.0.0.0:*               LISTEN      808/php-fpm: master 
    Seems the service didn't run
    There's a log where i can inspect?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    That's a good question, systemd is notreally userfriendly in my opinion. Maybe you find something in syslog.
     
  11. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    usually not - but I still assume an issue with the default [www] fpm-service. without it configured properly, the service won't start and ISPConfig gets confused a bit.
    The port numbers are not used @StefanoBertoli , they just need to be unused.

    Please double check the paths within and of /opt/php-5.6/etc/php-fpm.conf to be correct, aswell as the other settings.
    What happens if you run
    Code:
    $/opt/php-5.6/sbin/php-fpm --nodaemonize --fpm-config /opt/php-5.6/etc/php-fpm.conf
    
    or just 
    $/opt/php-5.6/sbin/php-fpm
    
     
  12. or
    found that error
    Code:
    [18-May-2018 15:43:41] ERROR: Unable to globalize '/opt/php-5.6/etc/php-fpm.d/*.conf' (ret=2) from /opt/php-5.6/etc/php-fpm.conf at line 545.
    [18-May-2018 15:43:41] ERROR: failed to load configuration file '/opt/php-5.6/etc/php-fpm.conf'
    [18-May-2018 15:43:41] ERROR: FPM initialization failed
     
  13. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    ok, we now need to know what is going on in
    /opt/php-5.6/etc/php-fpm.conf at line 545

    as the error tells us :)
     
  14. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    ah stupid me, it already tells us ...
    /opt/php-5.6/etc/php-fpm.d/*.conf


    no .conf files

    either place the [www] part out of the php-fpm.conf and move it as new file into www.conf in that directory or create a dummy fpm.conf / or even dummy page for it.


    issue is: daemon doesn't start with empty directory and ISPConfig kind of expects the daemon to be running or else it will mix up the different versions.


    A basic conf will do like
    Code:
    [root@host] /etc/php/7.1/fpm# cat pool.d/www.conf  | grep -v ";"
    [www]
    user = www-data
    group = www-data
    listen = /run/php/php7.1-fpm.sock
    listen.owner = www-data
    listen.group = www-data
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    
    well yeah I was lazy, used precompiled package from php maintainer so I have 5.6 to 7.2 on my system, well organized folder structure, working as a treat except this dummy config :)

    edit: don't forget to move sections, it won't start having two [www] pools cause of the name and probably same port, too. move it move it move it - I like to :)
     
    Last edited: May 18, 2018
  15. So i think i solved simply removing the line 545, now it don't need any .conf file, the www section is already in the php-fpm.conf file
    perhaps previously i installed php-fpm from apt.
    if I executed a which and I see it is using the apt one and not compiled one...
    Code:
    which php-fpm5.6
    /usr/sbin/php-fpm5.6
    May I
    Code:
    apt-get remove php5.6*
    or
    Code:
    apt-get remove --purge php5.6*
    Can this influence the compiled one?
    How I change default php5.6 using the compiled one instead the installed one? (I don't remember and I wont'd crash something)
     
  16. Oops... I think that folder is needed for www's files so it's not real what I wrote... Did you confirm?
     
  17. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    yeah, ispconfig will place additional conf files into the folder for each website. so the line is important, it includes the different files.
    Check that the directory exists, the include line is working again and if it complaints, move the [www] section out of the php-fpm.conf to its own .conf in the pool directory.
    This will get it working.

    I don't know what you have on your system to be able to remove another php 5.6 installation, but this is something you should know what how where it is.

    Setting phps default can be done using a lot of
    Code:
    update-alternatives --config
    
    you might have to set up a lot of symlinks - don't forget phpize, php-cgi, php, php-fpm, ... look into bin/sbin dir
     
  18. Inspecting PHP7.2 php-fpm.conf file result:
    Code:
    /opt/php-7.2/etc# cat php-fpm.conf | grep -v ";"
    [global]
    pid = run/php-fpm.pid
    include=/opt/php-7.2/etc/php-fpm.d/*.conf
    
    Inspecting PHP7.2 php-fpm.d file result:
    Code:
    /opt/php-7.2/etc/php-fpm.d# cat www.conf | grep -v ";"
    [www]
    user = www-data
    group = www-data
    listen = 127.0.0.1:8998
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    
    Inspecting PHP5.6 php-fpm.conf file result:
    Code:
    /opt/php-5.6/etc# cat php-fpm.conf | grep -v ";"
    [global]
    pid = run/php-fpm.pid
    [www]
    user = www-data
    group = www-data
    listen = 127.0.0.1:8997
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    
    This show differences between 2 versiones.
    If I understood right the right way is to move the www section out of file and create folder php-fpm.d/www.conf

    Thanks
     

Share This Page