![带有 Apache 2.4 的 php5.6-fpm 在 Ubuntu 14.04 上显示 php 源代码](https://linux22.com/image/691597/%E5%B8%A6%E6%9C%89%20Apache%202.4%20%E7%9A%84%20php5.6-fpm%20%E5%9C%A8%20Ubuntu%2014.04%20%E4%B8%8A%E6%98%BE%E7%A4%BA%20php%20%E6%BA%90%E4%BB%A3%E7%A0%81.png)
我的 Ubuntu Vagrant 显示 PHP 源代码而不是解释 PHP 脚本。我做错了什么?
我的apache.conf:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
我的虚拟主机配置:ServerName kunstmaan.cms
DocumentRoot "/var/www/logus/web"
AllowOverride All
Require all granted
(...)
</Directory>
服务-cgi-bin.conf
<IfModule mod_alias.c>
<IfModule mod_cgi.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfModule mod_cgid.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>
</IfModule>
/etc/apache2/conf-enabled/php5-fpm.conf
<IfModule mod_fastcgi.c>
AddHandler php5.fcgi .php
Action php5.fcgi /php5.fcgi
Alias /php5.fcgi /usr/lib/cgi-bin/php5.fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5.fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>
cgi-bin 目录是空的:
ls -la /usr/lib/cgi-bin/
total 8
drwxr-xr-x 2 www-data www-data 4096 Oct 6 12:29 ./
drwxr-xr-x 69 root root 4096 Oct 12 00:10 ../
/etc/php5/fpm/pool.d/www.conf
user = www-data
group = www-data
...
listen = /var/run/php5-fpm.sock
listen.owner = www-data
listen.group = www-data
ls 中没有套接字:
$ sudo ls -la /var/run/php5-fpm.sock
ls: cannot access /var/run/php5-fpm.sock: No such file or directory
我注意到我有 2 个服务:php5-fpm 和 php5.6-fpm,当我启动第二个服务时,它会永远保持“启动/运行”状态。我可以停止它,它会长时间处于“停止/等待”状态。
我该如何解决?