v8js Ubuntu 16
From DreamFactory
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
- Install Dependencies
-
$ sudo apt-get install build-essential git python libglib2.0-dev
-
- Install Depot Tools
-
$ cd /tmp
-
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
-
$ export PATH=`pwd`/depot_tools:"$PATH"
-
- Download V8
-
$ fetch v8
-
- Setup GN
-
$ cd v8
-
$ tools/dev/v8gen.py -vv x64.release
-
$ echo is_component_build = true >> out.gn/x64.release/args.gn
-
- Build v8
-
$ ninja -C out.gn/x64.release/
-
- 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/
-
- 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
-