尝试将池用作不同的用户时出现Apache 2.4和PHP7.0-FPM问题

我目前正在试图从PHP 5.6升级到PHP 7.0的开发机器。 我们目前的设置使用PHP-FPM池来使多个站点运行在Apache 2.4实例上,每个站点都有自己的Linux用户。

在PHP 5.6下,一切正常,每个站点都以自己的Linux用户身份运行。 但是,一旦安装了PHP 7.0,事情似乎没有按计划进行。 问题似乎是PHP7.0-FPM带有一个名为/etc/php/7.0/pool.d/www.conf的池,我在/etc/php5/fpm/pool.d没有这个池。

www.conf包含以下代码:

 ; pool name ('www' here) [www] ... user = www-data group = www-data ... listen = /run/php/php7.0-fpm.sock ... listen.owner = www-data listen.group = www-data ... 

这基本上是池的默认configuration,我没有改变这个文件中的任何东西。

如果我删除池,我的网站都没有工作,如果我修改user行,他们作为该用户运行,这意味着我所有的网站都使用这个池。

然而,我在/etc/apache2/sites-enabled/subdomain.domain.com.conf虚拟主机中定义的套接字与在/etc/php/7.0/fpm/pool.d/subdomain.domain.com.conf定义的相同/etc/php/7.0/fpm/pool.d/subdomain.domain.com.conf ,它出现在/run/php/php7.0-fpm_subdomain.domain.com.sock

我认为这可能是我的Apacheconfiguration的问题,但我似乎无法发现任何错误,即使在线复制了许多教程。

/etc/php/7.0/pool.d/subdomain.domain.com.conf包含以下代码:

 [subdomain.domain.com] user = myUser group = myUser listen = /run/php/php7.0-fpm_subdomain.domain.com.sock listen.owner = www-data listen.group = www-data pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / 

/etc/apache2/sites-enabled/subdomain.domain.com.conf包含以下代码:

 <VirtualHost *:80> ServerAdmin [email protected] ServerName www.subdomain.domain.com ServerAlias subdomain.domain.com DocumentRoot /home/myUser/website/ <Directory /> AllowOverride All </Directory> <Directory /home/myUser/website/> Options Indexes FollowSymLinks MultiViews AllowOverride all Require all granted </Directory> ErrorLog /var/log/apache2/subdomain.domain.com-error.log LogLevel error CustomLog /var/log/apache2/subdomain.domain.com-access.log combined <IfModule mod_fastcgi.c> AddHandler php7-fcgi_subdomain .php Action php7-fcgi_subdomain /php7-fcgi_subdomain virtual Alias /php7-fcgi_domain /usr/lib/cgi-bin/php7-fcgi_domain FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi_domain -socket /run/php/php7.0-fpm_subdomain.domain.com.sock -pass-header Authorization </IfModule> </VirtualHost> 

我相信在我的Apacheconfiguration中还有一些其他的东西可以改进,但是现在我只是把我的网站作为自己的用户来运行。

我几乎100%肯定有某种configuration某处导致我的网站使用默认的www.conf但我似乎无法find任何其他人有任何相同的问题的信息。

附加信息:

  • 服务器是Debian 8“Jessie”
  • Opcache未启用
  • phpinfo()工作和ServerAPI是FPM/FastCGI
  • PHP Version 7.0.20-1~dotdeb+8.2