v8js Ubuntu 16

From DreamFactory
Jump to: navigation, search

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

  1. Install Dependencies
    • <source lang="bash">$ sudo apt-get install build-essential git php7.1-dev php-pear</source>
  2. Copy the V8 library
  3. Build and Install v8js from source
    • <source lang="bash">$ git clone https://github.com/phpv8/v8js.git</source>
    • <source lang="bash">$ cd v8js</source>
    • <source lang="bash">$ git checkout 1.3.6</source>
    • <source lang="bash">$ git pull origin 1.3.6</source>
    • <source lang="bash">$ phpize</source>
    • <source lang="bash">$ ./configure --with-v8js=/opt/v8</source>
    • <source lang="bash">$ make</source>
    • <source lang="bash">$ sudo make install</source>
    • <source lang="bash">$ sudo sh -c 'echo "extension=v8js.so" > /etc/php/7.1/mods-available/v8js.ini'</source>
    • <source lang="bash">$ sudo phpenmod v8js</source>
  4. Restart Apache or Nginx and PHP-FPM