Can I use HHVM side by side with the regular PHP interpreter

。_饼干妹妹 提交于 2019-12-06 14:06:47

Even though you asked for nginx, here is an example (untested) Apache CGI configuration:

(sorry I don't know nginx)

<IfModule mod_fcgid.c>
    IdleTimeout 3600
    ProcessLifeTime 7200
    MaxProcessCount 64
    DefaultMaxClassProcessCount 8
    IPCConnectTimeout 300
    IPCCommTimeout 7200
    BusyTimeout 300

    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
        SetHandler application/x-httpd-php
    </FilesMatch>

    ScriptAlias /php-5.5.10-bin/ /opt/php/5.5.10/bin/
    ScriptAlias /php-5.4.17-bin/ /opt/php/5.4.26/bin/
    ScriptAlias /php-5.3.27-bin/ /opt/php/5.3.28/bin/
    ScriptAlias /php-5.2.17-bin/ /opt/php/5.2.17/bin/

    <Directory "/opt/php">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    <FilesMatch ".+\.hh$">
        SetHandler application/x-httpd-hhvm
    </FilesMatch>

    ScriptAlias /hhvm-2.4.2-bin/ /opt/hhvm/2.4.2/bin/

    <Directory "/opt/hhvm">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>

And the Virtual host:

<VirtualHost *:80>
    ServerAdmin hosting@example.com
    ServerName www.example.com
    ServerAlias example.com

    DocumentRoot /var/deployments/www.example.com/public
    <Directory /var/deployments/www.example.com>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
        Action application/x-httpd-php /php-5.5.10-bin/php-cgi
        Action application/x-httpd-hhvm /hhvm-2.4.2-bin/hhvm-cgi
    </Directory>

    ErrorLog /var/deployments/$serverName/log/www.example.com.error.log
    LogLevel warn
    CustomLog /var/deployments/$serverName/log/www.example.com.access.log combined
</VirtualHost>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!