2017-10-20 80 views
1

我已经按照这个教程来让PHP 5.6和PHP 7我的服务器上: Running two PHP versions on the same server运行在同一台服务器上的两个PHP版本(拉伸)

的事情是,我在Debian 9拉伸和跑步fastcgi模块不再可用。有proxy_fcgi,但不包括FastCgiExternalServer。我读过很多东西,但我无法弄清楚如何替换它...任何想法?

<ifModule mod_proxy_fcgi.c> 
    AddHandler php56-fcgi .php 
    Action php56-fcgi /php56-fcgi 
    Alias /php56-fcgi /usr/lib/cgi-bin/php56-fcgi 
    FastCgiExternalServer /usr/lib/cgi-bin/php56-fcgi -socket /var/run/php/php5.6-fpm.sock -pass-header Authorization 
    Action php70-fcgi /php70-fcgi 
    Alias /php70-fcgi /usr/lib/cgi-bin/php70-fcgi 
    FastCgiExternalServer /usr/lib/cgi-bin/php70-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization 
</IfModule> 
<Directory /usr/lib/cgi-bin> 
    Require all granted 
</Directory>` 

回答

0

我花了一段时间才能找出该怎么做,但最后我发现了一个简单的解决方案:

sudo apt-get install php5.6-fpm 

sudo apt-get install php7.0-fpm 

sudo a2enconf php5.6-fpm 

如果安装php5.6和php5.7,请务必关闭这两个并重新启动apache。

sudo a2dismod php5.6 php7.0 

sudo systemctl restart apache2 

在这一点上,所有的网站必须在PHP 5.6上工作。

对于谁需要PHP 7点,在虚拟主机中加入这一行:

ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/run/php/php7.0-fpm.sock|fcgi://localhost/path/to/my/main/file" 

它应该做的伎俩:)

相关问题