Skip to main content

Quick Tip: Install Recki-CT into a Vagrant Ubuntu Box

By Bruno Skvorc



Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

Recki what?

If you don’t know what Recki-CT is, see @ircmaxell’s original post or the repo, we won’t go into depth here. This quick tip will merely show you how to install it on a Homestead Improved box, much like we did with other software before.

Step 1 – Homestead Improved

First and foremost, get a Homestead Improved instance up and running.

Give it a new virtual host like so:

- map:
  to: /home/vagrant/Code/recki

Boot the VM and vagrant ssh into it.

Step 2 – JitFu

Recki-CT needs JitFu to be installed.

As per instructions, run the following commands in order while you’re in the VM.

sudo apt-get install bison flex texinfo

git clone git:// libijt-fu
cd libjit-fu
./configure --prefix=/opt
sudo make install

git clone
cd jitfu
./configure --with-jitfu=/opt
sudo make install

sudo su
echo "" >> /etc/php5/fpm/conf.d/20-jitfu.ini
echo "" >> /etc/php5/cli/conf.d/20-jitfu.ini

sudo service nginx restart
sudo service php5-fpm restart

To see if we installed it successfully:

cd ~/Code
git clone recki
mv recki/public/index.php recki/
touch recki/recki.php

Open recki.php and paste the following content inside it:

use JITFU\Context;
use JITFU\Type;
use JITFU\Signature;
use JITFU\Func;
use JITFU\Value;

$context = new Context();

$integer   = Type::of(Type::int);

$function = new Func($context, new Signature($integer, [$integer]), function($args) use($integer) {
    $zero     = new Value($this, 0, $integer);
    $one      = new Value($this, 1, $integer);
    $two      = new Value($this, 2, $integer);

    /* if ($arg == 0) return 0; */
        $this->doEq($args[0], $zero),
        function() use ($zero) {

    /* if ($arg == 1) return 1; */
        $this->doEq($args[0], $one),
        function() use($one) {

    /* return $function($arg-1) + $function($arg-2); */
            $this->doCall($this, [$this->doSub($args[0], $one)]),
            $this->doCall($this, [$this->doSub($args[0], $two)]))); 


var_dump($function(40)); /* __invoke with magicalness */

If you go to now, you should see JitFu support enabled in the PHPInfo screen. If you go to, you should get int 102334155 as output rather quickly.

Step 3 – Clone and Compose

Next up, we’ll need to clone the Recki repo, and download dependencies with Composer.

cd ~/Code
rm -rf recki
git clone recki
cd recki
composer install

Step 4 – Test

To see if it works, just run the examples via the command line:

php examples/01-basic-usage.php

or through the browser:

That’s all there is to it. Now you can focus on brutal optimizations of your PHP code in certain parts without having to replace the entire PHP engine your app is spinning on.

Bruno is a blockchain developer and code auditor from Croatia with Master’s Degrees in Computer Science and English Language and Literature. He's been a web developer for 10 years until JavaScript drove him away. He now runs a cryptocurrency business at via which he makes blockchain tech approachable to the masses, and runs Coinvendor, an on-boarding platform for people to easily buy cryptocurrency. He’s also a developer evangelist for, a San Francisco-based AI-powered machine vision web scraper.

New books out now!

Learn valuable skills with a practical introduction to Python programming!

Give yourself more options and write higher quality CSS with CSS Optimization Basics.