After some struggle, I finally installed Facebook HipHop Virtual Machine in Ubuntu. It is running under FastCGI (Apache 2.22). Below, the service status:
marcelo@marcelo-VirtualBox:~$ service apache2 status
Apache2 is running (pid 3330).
marcelo@marcelo-VirtualBox:~$ service hhvm status
* hhvm is running
marcelo@marcelo-VirtualBox:~$ sudo service hhvm restart
* Restarting HHVM FastCGI Daemon hhvm [ OK ]
marcelo@marcelo-VirtualBox:~$
The same machine has PHP5 module enabled and configured in Apache.
Question:
I want to make sure that I am really rendering PHP
code using HHVM
and NOT Zend Framework
.
All my PHP scripts are running on the webserver. But, when I disable PHP5 module using sudo a2dismod php5
the web server starts to render Internal Server Error
.
Does HHVM need PHP5 module enabled to run? Supposedly, since I am using FastCGI, my answer is no. On the other hand, I think that my pages are being rendered by Zend and not HHVM.
What am I missing here? How can I make sure that I am really running HHVM? (in my mind, a clear test is to disable PHP5 module, but, as I said, when I disable, php stops working in the web browser).
If .php is not running with PHP5 module
disabled does it means that my HHVM
is not properly configured?
P.S.: The script that I am testing is a default Hello World example: <?php echo 'Hello World.'; ?>
.
And, It works when I run from command line:
marcelo@marcelo-VirtualBox:/var/www$ sudo hhvm hello_world.php
Hello World.
marcelo@marcelo-VirtualBox:/var/www$
EDIT
(Apparently, I should have 'hhvm.fastcgi' file. I only have the directory. Is anything wrong here?)
- FastCGI configuration:
I added the lines below, as suggested here: https://github.com/facebook/hhvm/wiki/FastCGI, at the end of apache2.conf file. In other words, after all 'mods-enabled' were already loaded.
# fastcgi added by M. Sardelich
<IfModule mod_fastcgi.c>
Alias /hhvm.fastcgi /var/www/fastcgi/hhvm.fastcgi
FastCGIExternalServer /var/www/fastcgi/hhvm.fastcgi -socket /var/run/hhvm/socket -pass-header Authorization -idle-timeout 300
<Directory "/var/www/fastcgi">
<Files "hhvm.fastcgi">
Order deny,allow
</Files>
</Directory>
AddHandler hhvm-hack-extension .hh
AddHandler hhvm-php-extension .php
Action hhvm-hack-extension /hhvm.fastcgi virtual
Action hhvm-php-extension /hhvm.fastcgi virtual
</IfModule>