apache2配置php-fpm

apache

LoadModule proxy_module  modules/mod_proxy.so
LoadModule proxy_http_module  modules/mod_proxy_http.so
LoadModule proxy_fcgi_module  modules/mod_proxy_fcgi.so
LoadModule rewrite_module  modules/mod_rewrite.so

Apache vhost配置模块中加入

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
Include /etc/httpd/sites-enabled/ 
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1

php-fpm配置

listen=127.0.0.1:9000

参考:
https://www.andrewletson.com/installing-apache-2-4-php-5-4-centos-6-5/
https://cnzhx.net/blog/centos-7-mod_php-to-php-fpm/

发表评论

电子邮件地址不会被公开。 必填项已用*标注