通过调整来自这个 askubuntu 线程、这个 HowtoForge 文档和这个 Digital Ocean 教程的说明,我已经设法让 FastCGI 在 Ubuntu 16.04 上与 Apache 2.4 一起工作。
所有这些消息来源都说要创建 /etc/apache2/conf-available/php7.0-fpm.conf
并告诉您要放入什么。但是安装后php-fpm
,我已经有了那个文件,内容如下:
# Redirect to local php-fpm if mod_php is not available
<IfModule !mod_php7.c>
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
</FilesMatch>
<FilesMatch ".+\.phps$">
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in …
Run Code Online (Sandbox Code Playgroud)