2

I just managed to set up a Apache 2.4 server using HHVM in FastCGI mode using that ProxyPassmatch directive. The problem is, I can now set a differen root path for each host but I can not set any other configuration parameters per VHost, like include_path, error_log or other classic PHP settings...

VHost File:

<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>

There are some reports that I can set up virtual hosts in HHVM too, but since Fast-CGI this seems to be deprecated. And even then, I would have to provide VHost settings in a seperate file in addition to my Apache VHost file.

So... How can I provide HHVM with different configurations per VHost?


Update Seems I discuvered a Bug (or missing feature) of HHVM while using the FcgidInitialEnv (or fastcgi_param on Nginx) approach described in the answer.

https://github.com/facebook/hhvm/issues/3730

1 Answer 1

1

You can pass parameters through the PHP_VALUE environment variable.

In Apache, you would use the FcgidInitialEnv directive (which is applicable to virtual hosts) to define all parameters in a single line.

FcgidInitialEnv PHP_VALUE "include_path=.:/var/www/host1/includes \n error_log=/var/www/host1/log/php_error.log"
3
  • Sounds promissing, I'll try that ...
    – ToBe
    Sep 10, 2014 at 15:12
  • After installing mod_fcgid, the directive is accepted. It's not affecting my HHVM however. I tried before and after ProxyPassMatch directive and restarted HHVM and Apache. ini_get('include_path') still is unchanged. Anything else? Is there some Info on the PHP_VALUE parameter and it's use?
    – ToBe
    Sep 10, 2014 at 15:26
  • Tryed NGINX now with same result. I can see the PHP_VALUE in the $_SERVER array but it did not have any effect on the ini values.
    – ToBe
    Sep 11, 2014 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .