Giter Site home page Giter Site logo

hhvm-vagrant-vm's Introduction

HHVM-Vagrant-VM

Description

Setup a test environment for HHVM.

The final VM will contain HHVM, Nginx, PHP, MySQL, ab.

Requirements

Installation

Clone the repository:

$ git clone https://github.com/javer/hhvm-vagrant-vm
$ cd hhvm-vagrant-vm

And copy your project source into this folder:

$ cp -R /var/www/site/* ./

Finally, you should run:

$ vagrant up

By default the VM uses 2GB of memory and 4 CPU core. If you want to use more memory or cores you can edit this settings directly in the Vagrantfile.

If something goes wrong (i.e. insufficient memory when compiling HHVM), you can log into the virtual machine and run building HHVM manually:

$ vagrant ssh
$ sudo -s
$ cd /root/dev/hhvm
$ export CMAKE_PREFIX_PATH=`pwd`/..
$ make -j3

Once everything is done you can log into the virtual machine, setup your project in /var/www/site folder:

$ vagrant ssh
$ cd /var/www/site
$ ...

Start HHVM:

$ sudo /etc/init.d/hhvm start

Now you can browse your project on the host machine by entering http://127.0.0.1:9080 for serving site using PHP-FPM and http://127.0.0.1:9081 for serving site using HHVM.

Virtual Machine Management

When done just log out with ^D and suspend the virtual machine

$ vagrant suspend

then, resume to testing again

$ vagrant resume

Run

$ vagrant halt

to shutdown the virtual machine, and

$ vagrant up

to boot it again.

You can find out the state of a virtual machine anytime by invoking

$ vagrant status

Finally, to completely wipe the virtual machine from the disk destroying all its contents:

$ vagrant destroy

Information

  • Virtual Machine user/password: vagrant/vagrant
  • Serving site using PHP: http://127.0.0.1:9080/
  • Serving site using HHVM: http://127.0.0.1:9081/
  • SSH into your vm using your favorite ssh client: ssh://127.0.0.1:2222 (username+password: "vagrant")
  • Start nginx: sudo /etc/init.d/nginx start
  • Start php-fpm: sudo /etc/init.d/php5-fpm start
  • Start HHVM: sudo /etc/init.d/hhvm start

Updating

For building latest version of HHVM you should run the following command on the host machine:

$ vagrant destroy && vagrant up

hhvm-vagrant-vm's People

Contributors

javer avatar staabm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.