I've tried to test hhvm (on my local machine), but did not manage to get it working.

Important side-note: I need to run mod_php and fcgi at the same time. It's not possible to abandon mod_php for me (at least not at the moment).

Using debian 7.8

I managed to install a working version of php over fcgi with my existing mod_php still working. They're both running - one using Server API: Apache 2.0 Handler and the other one using Server API: CGI/FastCGI.

I then installed (a precompiled package) of hhvm. No Problem. (Precompiled because I do not wanted to waste time compiling). I startet the server, but I does not use hhvm - still using php (fcgi).

I've read about the script /usr/share/hhvm/install_fastcgi.sh and tried this. This gives me the following output:

Checking if Apache is installed
Detected Apache installation
Looking for custom proxy configuration
No custom proxy configuration found
Checking for enabled proxy_fcgi.load
Not found
Checking for enabled fastcgi.load
Not found
Checking for enabled fcgid.load
Found, checking for loading directives
Detected enabled fcgid.load configuration, setting up integration
Force enabling module hhvm_fcgid.conf
WARNING: Unsupported hhvm_fcgid, not configuring
Restarting apache
Apache is running, restarting
[ ok ] Restarting web server: apache2 ... waiting .
Finished restarting
Finished restarting apache
Checking if Nginx is installed
Nginx not found

So configuration did not work.

For fcgid I use the following apache vhost file:

<VirtualHost *:8000>

<IfModule mod_fcgid.c>
FcgidBusyTimeout 3600

ServerAdmin webmaster@localhost
ServerAlias h.path1.local

DocumentRoot /var/www/path1
#SuexecUserGroup user1 user1

#ScriptAlias /awstats/ /usr/lib/cgi-bin/
#we want specific log file for this server

#ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://$1

<Directory "/var/www/path1">
   FcgidWrapper /var/www/path1_conf_hhvm .php
    <FilesMatch \.php$>
      SetHandler fcgid-script
    Options +ExecCGI
    Order allow,deny
    Allow from all
    AllowOverride FileInfo All


Port 8000 is, because apache sits behind a varnish.

No I'm using a wrapper file for fcgi. This only contains:

 export PHPRC="/etc/php5/cgi"
 exec /usr/bin/php5-cgi

I guess that I need to change something here to let is use hhvm instead of php. So I tried to use exec /usr/bin/hhvm - which does not work. I get

[warn] [client] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[error] [client] Premature end of script headers: test.php

And now I'm lost. How to tell fcgid to use hhvm instead of php? Do I need to change the wrapper script (or abandon it completly and use something else)?

Any help appreciated.


I had to move on apache 2.4 in order to have the missing mods (fastcgi)

sudo apt-get install libapache2-mod-fastcgi

but moving in 2.4 prevent apache to use libapache2-mod-php5, so I had to use php-fpm. I followed this tutorial (sorry it's in french)


After this, I installed hhvm like described here


finally, I run the command

 sudo hhvm -daemon -c server.ini -p 8080

if everything is ok, call somewhere a phpinfo() it should replace your php configuration with hhvm

hope it helps maybe later than naver

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.