我刚刚使用ProxyPassmatch指令设法在FastCGI模式下使用HHVM设置Apache 2.4服务器。 问题是,我现在可以为每个主机设置不同的根path,但不能为每个VHost设置任何其他configuration参数,如include_path,error_log或其他经典的PHP设置…
VHost文件:
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName host1.local DocumentRoot /var/www/host1/root ErrorLog ${APACHE_LOG_DIR}/host1_error.log CustomLog ${APACHE_LOG_DIR}/host1_access.log combined ProxyPassMatch (.php)$ fcgi://127.0.0.1:9000/var/www/host1/root # php_value include_path ".:/var/www/host1/includes" # php_value error_log "/var/www/host1/log/php_error.log" <Directory /var/www/host1/root> AllowOverride All </Directory> </VirtualHost>
有一些报告说我也可以在HHVM中build立虚拟主机,但是由于Fast-CGI似乎被弃用了。 即使如此,除了我的Apache VHost文件之外,我还必须在单独的文件中提供VHost设置。
所以…我怎么能提供不同configuration的HHVM每VHost?
更新似乎我讨论了在回答中描述的使用FcgidInitialEnv(或Nginx上的fastcgi_param)方法时HHVM的错误(或丢失的function)。
https://github.com/facebook/hhvm/issues/3730
您可以通过PHP_VALUE环境variables传递参数。
在Apache中,您可以使用FcgidInitialEnv指令(适用于虚拟主机)在一行中定义所有参数。
FcgidInitialEnv PHP_VALUE "include_path=.:/var/www/host1/includes \n error_log=/var/www/host1/log/php_error.log"