apache2.4,php-fpm,proxypassmatch“没有协议处理程序对URL有效..”

时间:2018-01-20 11:26:35

标签: php apache

我一直试图让apache2.4 vhost将php请求传递给php5-fpm。

我已经配置了php5-fpm来监听套接字,这行在/etc/php5/fpm/pool.d/www.conf中:

listen = /var/run/php5-fpm.sock

我在此特定计算机上配置的唯一vhost是默认主机。这就是我配置它的方式:

<VirtualHost *:80>

        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/default-error.log
        CustomLog ${APACHE_LOG_DIR}/default-access.log combined


        ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:///var/run/php5-
        fpm.sock|fcgi://127.0.0.1/var/www/html/

        DirectoryIndex /index.php index.php


</VirtualHost>

配置完成后,我重新启动了apache。对测试php文件的请求会在错误日志中生成此消息。

  

[client 10.0.2.2:51434] AH01144:没有协议处理程序对   URL /info.php。如果您使用的是mod_proxy的DSO版本,请确保   代理子模块包含在配置中使用   的LoadModule。

我有理由相信我安装了正确的模块。 'apachectl -M'返回以下内容:

Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 fastcgi_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_fcgi_module (shared)
 proxy_http_module (shared)
 setenvif_module (shared)
 status_module (shared)

我错过了什么?

1 个答案:

答案 0 :(得分:0)

这可能是Debian中的错误。它适用于Sub BoxCheck() Dim shp, rectName as string Set shp = ActiveSheet.Shapes(Application.Caller) rectName = Replace(Application.Caller, "Check Box ", "Rectangle ") ActiveSheet.Shapes(rectName).Fill.ForeColor.SchemeColor = _ IIf(shp.ControlFormat.Value = 1, 3, 1) End Sub ,但不适用于SetHandler "proxy:fcgi://127.0.0.1:9000/"。您的情况是php5-fpm.sock。从套接字切换时,请注意端口号9000。

所以答案是:更改php-fpm以在ip:port上监听

"sock:/var/run/php7.0-fpm.sock"

瞧瞧!

注意:尝试在VirtualHost定义中使用listen = 127.0.0.1:9000 。这是我看到的:

LogLevel debug