v8js

From DreamFactory
Jump to: navigation, search

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

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