php-fpm does not work

Discussion in 'Installation/Configuration' started by vistree, Jun 5, 2018.

  1. vistree

    vistree Member HowtoForge Supporter

    I have a standard ispconfig 3 on debian 8.1 with PHP 5.6.33
    Now I try to set some domains to php-fpm (without extra php version). As soon I enable php-fpm the site is not accessable any more - in log file I find
    [Tue Jun 05 22:11:04.941313 2018] [fastcgi:error] [pid 8742] (2)No such file or directory: [client 89.182.79.203:49815] FastCGI: failed to connect to server "/var/www/clients/client1/web10/cgi-bin/php5-fcgi-148.251.87.82-80-my-domain.de": socket file descriptor (1230) is larger than FD_SETSIZE (1024), you probably need to rebuild Apache with a larger FD_SETSIZE
    [Tue Jun 05 22:11:04.941330 2018] [fastcgi:error] [pid 8742] [client 89.182.79.203:49815] FastCGI: incomplete headers (0 bytes) received from server "/var/www/clients/client1/web10/cgi-bin/php5-fcgi-148.251.87.82-80-my-domain.de"
    Do I miss anything? Tried to change fpm-options for this domains to socket, ondemand, ... - but always the same error ...
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Is php-fpm installed and running?

    Run back through the perfect server guide and make sure everything is installed, and maybe run the update.php from an ISPConfig distribution and let it reconfigure services.
     
  3. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    hmm debian 8... have you installed mod_fastcgi by chance ( not mod_fcgid ) ? and have you properly patched it? else it may spit these issues along some othrs.
    Unfortunally I'd have to check some backups for a working version ... net resources have been very limited when 7 and 8 was stable but fastcgi is the only option you have really ( for a good setup / fewest hacking needs ^^ ) :/
    If I recall correctly mod_fastcgi is in deb 7 but gone missing in 8 + license issues and whatnot ... do you need this old setup?

    and may I ask wether this is a virtualized environment?
     
    Last edited: Jun 6, 2018
    till likes this.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you followed the perfect server guide for Debian 8, then mod_fastcgi should be installed correctly. Please recheck your setup to ensure that you did not missed a step. mod_fastcgi exists in Debian 8, it has been removed in Debian 9 and there is no patching required for Debian 8, at least I never had to patch it yet and I run several Debian 8 servers, so this should not be an issue here.

    Here is the tutorial:

    https://www.howtoforge.com/tutorial/perfect-server-debian-8-jessie-apache-bind-dovecot-ispconfig-3/
     
    ztk.me likes this.
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    ztk.me likes this.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Btw. Using php-fcgi mode instead of php-fpm should work, but php-fpm is probably more resource friendly which means you can either patch mod_fastcgi or use php-fcgi instead of php-fpm in the sites, at least for those that exceed the 1024 file handle limit or upgrade the server to Debian 9 which does not require mod_fastcgi for php-fpm anymore.
     
    Jesse Norell and ztk.me like this.
  7. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    @till might be I do mix it up and I had to compile it before having it on debian ... been almost a decade :D
    but I do remember well the debian fastcgi wasn't perfect, at least at one state totally unuseable and needed some patching. file were somewhere hidden on fastcgi.com - however website is taken offline now :( some never made it into debian, maybe redhat has them still

    I don't recall having issues with file descriptiors though - but it's easily found using the error message and google :D
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I know now, corrected my original answer in post #5 :) I guess his best option would be to update to Debian 9 on the long run.
     
    ztk.me likes this.
  9. vistree

    vistree Member HowtoForge Supporter

    Hi all. Thanx for your massiv help!!! I was so sure that php-fpm already worked - but thought it was maybe on an other server. @till what you describe makes totally sense: I change around 1200 alias domains to real domains last week (had a related ticket here in the forum). I counted the number of vhosts and the result is exactly the number I posted in the error code above - 1230.
    In the moment all vhosts are set to Fast-CGI. But this causes a big problem on the server as load average is to hight. The machine has 64 GB RAM and it is used all right now. Round abount 22 GB by mysql - but the rest by all those php-cgi processes
    That's the reason I wanted to change to php-fpm. Setting ONE domain to PHP-FPM caused the error posted in my initial post.
    So I will try to find out on how to patch php-fpm (thanx Till for the link!).
    Am I right that upgrading to Debian 9 will not solve the problem?
    As a site note: ISPconfig is installed regarding the perfect server guide Till posted - and mod_fastcgi is installed and running
     
  10. vistree

    vistree Member HowtoForge Supporter

  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Probably yes.

    I did not test that with a perfect server setup yet as my systems are still at Debian 8. But I upgraded my perfect server based systems from debian 6 to 7 to 8 with these instructions, so I would say it should work for Debian 8 to 9 too. But there may always be some issues or incompatibilities in config files that need to be fixed after such a system upgrade.
     
    vistree likes this.
  12. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    just be aware of the new versions.
    apache 2.4 for example uses different syntax for allow/deny now, u probably want to check wether you need any modules like mod_php but I guess u removed them anyway already and run apache_mpm_worker - or a backported version from debian testing using mpm_event to reduce some memory in favour of speed?

    usually debian 8>9 works quiet well, no apocalypse - but I do few machines only compared to some others :)
    but overall, since you use new hardware, it will get utilitized better with newer debian, do you use stock mysql database?
    be prepared to switch to mariadb and some optimizations aswell.


    edit: oh and php - https://www.howtoforge.com/community/threads/install-php-5-6-30-not-working.79087/#post-374196 :)
    do you use roundcube plugin enigma? doesn't work in debian 9
     
    Last edited: Jun 6, 2018
    vistree likes this.
  13. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    As mentioned, 8->9 should work fairly well, with a few things to fix/cleanup afterwards.

    Note your default php version changes, which could adversely affect some websites. I made an explicit "additional php version" for 5.6 (wheezy default) and changed all sites to that prior to the update so nothing switched versions. (And followed up with converting most sites to 7.0, only a few (maybe 5-10%?) didn't work and stayed at 5.6.) The sury.org repositories should make that easy (install sury's 5.6 along with the system 5.6, and convert to that).

    There were a few configuration issues to work out, most of which are pretty well covered in various forum posts here. One not yet mentioned is to add 'sql_mode="NO_ENGINE_SUBSTITUTION"' to a mysql config file (I used /etc/mysql/conf.d/mariadb.cnf) and there may have been a couple other mysql config changes needed.
     
    ztk.me likes this.
  14. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    and don't forget the crons... some users may have full cron using /usr/bin/php expecting 5.6 but getting 7.x
    this can be changed by installing / update-alternatives - however, upgrading using surys repo seems to revert that, need to contact him on that misbehaviour :/ but I'm not doing much anymore today *sigh

    edit: and very rare cases - if any - someone experimenting with cgi-bin using #!/usr/bin/php
    2nd edit: yeah of course, I know who uses #!/...php .... I do omg but not in cgi-bin ; some +x cronfiles in /private/ dir
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Just as info, this (quite annoying) requirement has been removed with 3.1.12 :)
     
    ahrasis and ztk.me like this.
  16. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    ahrasis likes this.

Share This Page