User Tools

Site Tools


linux_server_manuals:apache_http_2_php-fpm

This is an old revision of the document!


apache + php-fpm

php 7 nicht thread safe.
d.h. für mod_php muss man mpm_prefork verwenden. langsam bei vielen verbindungen, und unterstützt http/2 nur bedingt, in zukfunt wohl gar nicht mehr.
deshalb um mpm_event zu verwenden, umstellefn auf php-fpm + mod_proxy_fcgi

aptitude install php-fpm

a2enmod proxy_fcgi

if enabled:

a2dismod php7.0
aptitude purge libapache2-mod-php

a2dismod mpm_prefork
a2enmod mpm_event

create file
/etc/apache2/mods-enabled/proxy_fcgi.conf

<IfModule proxy_fcgi_module>

      <FilesMatch "\.php$">
          <If "-f %{REQUEST_FILENAME}">
              SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost/"
          </If>
      </FilesMatch>

</IfModule>

restart apache

see https://wiki.apache.org/httpd/PHP-FPM
especially about ulimit and future issues if too many connection are opened.
and especially the caveeats! don't allow document upload into document root!!!

/etc/apache2/mods-enalbed/http2.conf

<IfModule http2_module>

      Protocols h2 h2c http/1.1
      H2Direct on

</IfModule>

You could leave a comment if you were logged in.
linux_server_manuals/apache_http_2_php-fpm.1515828830.txt.gz · Last modified: 2018/01/13 07:33 by ronney