v8js

From DreamFactory
Jump to: navigation, search

This module allows you to execute server-side JavaScript, using the V8 engine.

These instructions area adapted from https://github.com/phpv8/v8js/blob/master/README.Linux.md

  1. Install Dependencies
    • $ sudo apt-get install build-essential git python libglib2.0-dev
  2. Install Depot Tools
    • $ cd /tmp
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ export PATH=`pwd`/depot_tools:"$PATH"
  3. Download V8
    • $ fetch v8
  4. Setup GN
    • $ cd v8
    • $ tools/dev/v8gen.py -vv x64.release
    • $ echo is_component_build = true >> out.gn/x64.release/args.gn
  5. Build v8
    • $ ninja -C out.gn/x64.release/
  6. Install to /opt/v8
    • $ sudo mkdir -p /opt/v8/{lib,include}
    • $ sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin /opt/v8/lib/
    • $ sudo cp -R include/* /opt/v8/include/
  7. Build and Install v8js from source
    • $ cd /tmp
    • $ git clone https://github.com/phpv8/v8js.git
    • $ cd v8js
    • $ phpize
    • $ ./configure --with-v8js=/opt/v8
    • $ make
    • $ make test
    • $ sudo make install
    • $ sudo sh -c 'echo "extension=v8js.so" > /etc/php/7.0/mods-available/v8js.ini'
    • $ sudo phpenmod v8js