Composer and HHVM on Ubuntu 13.10


Today I’ve been playing around with running HHVM to run the various codebases I maintain, and tools I use. I thought I’d jot down some of the process I’ve gone through for getting everything working.

My test system is a fresh install of Ubuntu Server 13.10. Update the system and install git.

Add the HHVM repo to /etc/apt/sources.list.d/hhvm.list as indicated in https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Ubuntu-13.10, then update and install hhvm.

Open /etc/hhvm/config.hdf and add the following to the end of the file:

ResourceLimit {
  SocketDefaultTimeout = 20
}

Create the directory ~/bin, cd to it, then wget http://getcomposer.org/composer.phar. For convenience, symlink ~/bin/composer.phar to ~/bin/composer. You may need to execute your ~/.profile again if you didn’t have a ~/bin directory, so that it will be added to your PATH.

Create /usr/bin/php with permission o+x and open in your editor, and add the following:

#/bin/env bash
/usr/bin/hhvm --config=/etc/hhvm/config.hdf "$@"

In my first test, I did a composer create-project of Zend Framework 2. Because HHVM currently lacks the ZIP extension, you will need to specify –prefer-source to composer, so that it clones the originating repositories directly.


justin@hhvm-server:~/git$ composer create-project --prefer-source zendframework/zendframework zf2 2.2.4
Cannot open log file: /var/hhvm/error.log
HipHop Strict Warning: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in phar://composer.phar/bin/../src/../src/Composer/Console/Application.php on line 65
SlowTimer [6552ms] at curl: https://packagist.org/p/provider-latest$c1b101a7be30d60de5a51ef544437f8410df07bad8b83250fbfe8b6aaae83219.json
Installing zendframework/zendframework (2.2.4)
- Installing zendframework/zendframework (2.2.4)
Cloning 5b03d868755c181fc9b5dc56c1f8c26e73ca0bed

Created project in zf2
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing ircmaxell/security-lib (dev-master d63da10)
Cloning d63da10d863b819289059de850c920b1cd98204d

- Installing ircmaxell/random-lib (dev-master 3c2c5bf)
Cloning 3c2c5bf6c82ff1c532c11478b43c335ddf3f6821

- Installing doctrine/lexer (v1.0)
Cloning 2f708a85bb3aab5d99dab8be435abd73e0b18acb

- Installing doctrine/annotations (v1.1.2)
Cloning 40db0c96985aab2822edbc4848b3bd2429e02670

- Installing ocramius/proxy-manager (0.4.1)
Cloning 880ea3f2458d21781bcf3319b6756e69e9b322c4

- Installing symfony/yaml (v2.3.6)
Cloning 6bb881b948368482e1abf1a75c08bcf88a1c5fc3

- Installing phpunit/php-text-template (1.1.4)
Cloning 5180896f51c5b3648ac946b05f9ec02be78a0b23

- Installing phpunit/phpunit-mock-objects (1.2.3)
Cloning 5794e3c5c5ba0fb037b11d8151add2a07fa82875

- Installing phpunit/php-timer (1.0.5)
Cloning 19689d4354b295ee3d8c54b4f42c3efb69cbc17c

- Installing phpunit/php-token-stream (1.2.1)
Cloning 5220af2a7929aa35cf663d97c89ad3d50cf5fa3e

- Installing phpunit/php-file-iterator (1.3.4)
Cloning acd690379117b042d1c8af1fafd61bde001bf6bb

- Installing phpunit/php-code-coverage (1.2.13)
Cloning 466e7cd2554b4e264c9e3f31216d25ac0e5f3d94

- Installing phpunit/phpunit (3.7.28)
Cloning 3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d

phpunit/php-code-coverage suggests installing ext-xdebug (>=2.0.5)
phpunit/phpunit suggests installing phpunit/php-invoker (>=1.1.0,<1.2.0)
Writing lock file
Generating autoload files
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? n

  1. No comments yet.
(will not be published)
*