Giter VIP home page Giter VIP logo

hhvm-mac's Introduction

HHVM 3.3 for Mac

HHVM page | Hacklang page | General group | Dev group | Twitter

HHVM (aka the HipHop Virtual Machine) is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time compilation approach to achieve superior performance while maintaining the flexibility that PHP developers are accustomed to. To date, HHVM (and its predecessor HPHPc before it) has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook compared with the PHP 5.2 engine + APC.

HHVM should be used together with a FastCGI-based webserver like nginx or apache.

FAQ

Our FAQ has answers to many common questions about HHVM, from general questions to questions geared towards those that want to use or contribute to HHVM.

Installing

CheckList

==========

  • CMake >= 3.0.2
  • Using ranlib from /opt/local/bin/ranlib or /usr/bin/ranlib
  • GCC 4.8
  • Boost 1.55+ and is compiled with GCC 4.8
  • JeMalloc compiled with patch.
  • OCaml 3/4 (hack requirement)

1. Install homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. Tap additional repositories

brew tap homebrew/versions

3. Install dependencies

brew install freetype gettext cmake git libtool mcrypt oniguruma re2c     \
             autoconf libelf readline automake mysql-connector-c pcre     \
             gd icu4c libmemcached pkg-config tbb imagemagick binutils    \
             curl imap-uw libxslt libevent sqlite homebrew/versions/gcc48 \
             openssl
brew install --build-from-source --cc=gcc-4.8 glog boost

Install some packages that are not (yet) part of homebrew:

brew install \
  https://gist.github.com/slbmeh/9059260/raw/1cbf0f6f5639b4a066395bedb702cdd6bd895d15/libdwarf.rb \
  https://gist.github.com/sgolemon/8fdc7e2afcd73a960b9c/raw/1211e21151ed3443dbc027e5383fb49e9eb1ab91/jemallocfb.rb

4. Get HHVM

git clone --recursive git://github.com/xssworm/hhvm-mac.git

5. Build HHVM

cd hhvm
cmake . \
    -DCMAKE_CXX_COMPILER=$(brew --prefix gcc48)/bin/g++-4.8 \
    -DCMAKE_C_COMPILER=$(brew --prefix gcc48)/bin/gcc-4.8 \
    -DCMAKE_ASM_COMPILER=$(brew --prefix gcc48)/bin/gcc-4.8 \
    -DLIBIBERTY_LIB=$(brew --prefix gcc48)/lib/x86_64/libiberty-4.8.a \
    -DCMAKE_INCLUDE_PATH="/usr/local/include:/usr/include" \
    -DCMAKE_LIBRARY_PATH="/usr/local/lib:/usr/lib" \
    -DLIBEVENT_LIB=$(brew --prefix libevent)/lib/libevent.dylib \
    -DLIBEVENT_INCLUDE_DIR=$(brew --prefix libevent)/include \
    -DICU_INCLUDE_DIR=$(brew --prefix icu4c)/include \
    -DICU_LIBRARY=$(brew --prefix icu4c)/lib/libicuuc.dylib \
    -DICU_I18N_LIBRARY=$(brew --prefix icu4c)/lib/libicui18n.dylib \
    -DICU_DATA_LIBRARY=$(brew --prefix icu4c)/lib/libicudata.dylib \
    -DREADLINE_INCLUDE_DIR=$(brew --prefix readline)/include \
    -DREADLINE_LIBRARY=$(brew --prefix readline)/lib/libreadline.dylib \
    -DCURL_INCLUDE_DIR=$(brew --prefix curl)/include \
    -DCURL_LIBRARY=$(brew --prefix curl)/lib/libcurl.dylib \
    -DBOOST_INCLUDEDIR=$(brew --prefix boost)/include \
    -DBOOST_LIBRARYDIR=$(brew --prefix boost)/lib \
    -DBoost_USE_STATIC_LIBS=ON \
    -DJEMALLOC_INCLUDE_DIR=$(brew --prefix jemallocfb)/include \
    -DJEMALLOC_LIB=$(brew --prefix jemallocfb)/lib/libjemalloc.dylib \
    -DLIBINTL_LIBRARIES=$(brew --prefix gettext)/lib/libintl.dylib \
    -DLIBINTL_INCLUDE_DIR=$(brew --prefix gettext)/include \
    -DLIBDWARF_LIBRARIES=$(brew --prefix libdwarf)/lib/libdwarf.3.dylib \
    -DLIBDWARF_INCLUDE_DIRS=$(brew --prefix libdwarf)/include \
    -DLIBMAGICKWAND_INCLUDE_DIRS=$(brew --prefix imagemagick)/include/ImageMagick-6 \
    -DLIBMAGICKWAND_LIBRARIES=$(brew --prefix imagemagick)/lib/libMagickWand-6.Q16.dylib \
    -DMYSQL_INCLUDE_DIR=$(brew --prefix mysql-connector-c)/include \
    -DMYSQL_LIB=$(brew --prefix mysql-connector-c)/lib \
    -DFREETYPE_INCLUDE_DIRS=$(brew --prefix freetype)/include/freetype2 \
    -DFREETYPE_LIBRARIES=$(brew --prefix freetype)/lib/libfreetype.dylib \
    -DLIBMEMCACHED_LIBRARY=$(brew --prefix libmemcached)/lib \
    -DLIBMEMCACHED_INCLUDE_DIR=$(brew --prefix libmemcached)/include \
    -DLIBELF_LIBRARIES=$(brew --prefix libelf)/lib/libelf.a \
    -DLIBELF_INCLUDE_DIRS=$(brew --prefix libelf)/include/libelf \
    -DLIBGLOG_LIBRARY=$(brew --prefix glog)/lib/libglog.dylib \
    -DLIBGLOG_INCLUDE_DIR=$(brew --prefix glog)/include \
    -DOPENSSL_SSL_LIBRARY=$(brew --prefix openssl)/lib/libssl.dylib \
    -DOPENSSL_INCLUDE_DIR=$(brew --prefix openssl)/include \
    -DOPENSSL_CRYPTO_LIBRARY=$(brew --prefix openssl)/lib/libcrypto.dylib \
    -DPCRE_LIBRARY=$(brew --prefix pcre)/lib \
    -DPCRE_INCLUDE_DIR=$(brew --prefix pcre)/include \
    -DTBB_INSTALL_DIR=$(brew --prefix tbb) \
    -DLIBSQLITE3_INCLUDE_DIR=$(brew --prefix sqlite)/include \
    -DLIBSQLITE3_LIBRARY=$(brew --prefix sqlite)/lib/libsqlite3.0.dylib
make -j4
sudo ln -s $(pwd)/hphp/hhvm/hhvm /usr/bin/hhvm

6. Test HHVM

hhvm --version

Running

You can run standalone programs just by passing them to hhvm: hhvm my_script.php.

If you want to host a website:

  • Install your favorite webserver nginx or apache
  • Install hhvm for Mac OS X 10.8.x / 10.9.x
  • Start your webserver
  • Go to the website root directory cd /Users/account/Sites
  • Run hhvm --mode server --user _www -vServer.Type=fastcgi -vServer.Port=9898
  • Visit your site at http://.../index.php

License

HHVM is licensed under the PHP and Zend licenses except as otherwise noted.

The Hack typechecker (hphp/hack) is licensed under the BSD license (hphp/hack/LICENSE) with an additional grant of patent rights (hphp/hack/PATENTS) except as otherwise noted.

hhvm-mac's People

Contributors

alexmalyshev avatar andrewparoski avatar bertmaher avatar danslo avatar dariorussi-zz avatar edwinsmith avatar fredemmott avatar grahamcampbell avatar haiping avatar jano avatar jdelong avatar jlreyes avatar joelmarcey avatar jwatzman avatar lcastelli avatar mxw avatar ottoni avatar oyamauchi avatar paroski avatar paulbiss avatar psaab avatar ptarjan avatar radford avatar scannell avatar sgolemon avatar siebelstim avatar simonwelsh avatar swtaarrs avatar tstarling avatar wizkid 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.