Web lists-archives.com

Re: [PHP] Re: php-fpm and apache

@lbutlr wrote:
Hi, I hate to repost, but I did not receive this message back from the list, so I am unsure it got posted. So it's not a complete repeat, I've added a little information.

I have php working within Apache 2.4 by adding the Proxy method to the virtual host, but am holding off on doing this for all the virtual hosts if I can avoid it.

    DocumentRoot /usr/local/www/roundcube/
    ProxyPassMatch ^/(.*\.php)$ fcgi://$1

I'd recommend creating a socket instead [lower overhead]. I do this for a few dozen virtual domains and it's been running smoothly for a few years.


  Protocols h2 http/1.1
  DocumentRoot /home/web_example1.com/websites/example1.com/www
  SuexecUserGroup web_example1 web_example1
  <FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/php7-fpm-example1.sock|fcgi://example1"
  <Proxy "fcgi://example1/">
  Require ip

The "" IP should be your public IP that the proxy can use [otherwise anyone can use your host as a proxy].

Then edit your /etc/php/7.0/fpm/pool.d/www.example1.com.conf with your path to the UNIX socket along with the rest of the php-fpm settings for your virtual domain.



PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php