v8js

From DreamFactory
Jump to: navigation, search
(Version 0.4.1)
Line 3: Line 3:
 
The Bitnami packages come with v8js already install and running. No further action is necessary.
 
The Bitnami packages come with v8js already install and running. No further action is necessary.
  
===Linux -- Debian/Ubuntu===
+
===Manual Installs===
====Version 0.1.3====
+
Check out the [[../../../APT/Ubuntu_16.04/Modules/V8JS| Ubuntu 16.04]] instructions for a concrete example.  
'''If you wish to install an older version of v8js, you can follow these instructions<br />Please note that this version of v8js does not support require(). In order to support require() you will need use version 0.3 or higher.'''
+
*Ensure that you have the php-pear and php5-dev packages installed on your system. You will also need to install the v8 dev library and g++ and cpp from the package manager
+
**<syntaxhighlight lang=bash>$ sudo apt-get install php-pear php5-dev libv8-dev g++ cpp</syntaxhighlight>
+
*Use PECL to make the v8js.so file
+
**<syntaxhighlight lang=bash>$ sudo pecl install v8js-0.1.3</syntaxhighlight>
+
**If the the install generates any errors it has failed. You will need to troubleshoot based on the error reported.
+
*Create a module file for your v8js installation.
+
**<syntaxhighlight lang=bash>$ sudo touch /etc/php5/mods-available/v8js.ini</syntaxhighlight>
+
*Edit the file you just created in your preferred text editor.
+
**There is a single line in the file it looks like this:
+
**<syntaxhighlight lang=bash>extension=v8js.so</syntaxhighlight>
+
*Enable the php extension
+
**<syntaxhighlight lang=bash>$ sudo php5enmod v8js</syntaxhighlight>
+
*Restart your web service service
+
**<syntaxhighlight lang=bash>$ sudo service apache2 restart</syntaxhighlight>  or
+
**<syntaxhighlight lang=bash>$ sudo service php5-fpm restart && sudo service nginx restart</syntaxhighlight>
+
  
====Version 0.4.1====
+
For all others, we recommend checking out [https://github.com/phpv8/v8js | PHP-V8JS on GitHub].
'''This is for a newer version of the driver, but requires manually compiling the library.'''
+
<br />''Instructions are adapted from [https://github.com/phpv8/v8js/blob/master/README.Linux.md  here]
+
 
+
*Ensure that you have the php-pear and php5-dev packages installed on your system. You will also need to install git, g++, and cpp from the package manager
+
**<syntaxhighlight lang=bash>$ sudo apt-get install php-pear php5-dev git g++ cpp</syntaxhighlight>
+
*Build the v8 library
+
<syntaxhighlight lang=bash>
+
$ cd /tmp
+
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
+
$ export PATH=`pwd`/depot_tools:"$PATH"
+
$ fetch v8
+
$ cd v8
+
$ git checkout 4.9.385.28
+
$ gclient sync
+
$ make native library=shared snapshot=off -j8
+
$ sudo mkdir -p /usr/lib /usr/include
+
$ sudo cp out/native/lib.target/lib*.so /usr/lib/
+
$ sudo cp -R include/* /usr/include
+
$ echo -e "create /usr/lib/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend" | sudo ar -M
+
$ sudo cp out/native/lib.target/lib*.so /usr/lib/x86_64-linux-gnu/
+
</syntaxhighlight>
+
*Use PECL to make the v8js.so file
+
**<syntaxhighlight lang=bash>$ sudo pecl install v8js-0.4.1</syntaxhighlight>
+
**If the the install generates any errors it has failed. You will need to troubleshoot based on the error reported.
+
*Create a module file for your v8js installation.
+
**<syntaxhighlight lang=bash>$ sudo touch /etc/php5/mods-available/v8js.ini</syntaxhighlight>
+
*Edit the file you just created in your preferred text editor.
+
**There is a single line in the file it looks like this:
+
**<syntaxhighlight lang=bash>extension=v8js.so</syntaxhighlight>
+
*Enable the php extension
+
**<syntaxhighlight lang=bash>$ sudo php5enmod v8js</syntaxhighlight>
+
*Restart your web service service
+
**<syntaxhighlight lang=bash>$ sudo service apache2 restart</syntaxhighlight>  or
+
**<syntaxhighlight lang=bash>$ sudo service php5-fpm restart && sudo service nginx restart</syntaxhighlight>
+

Revision as of 19:09, 28 February 2018

Modules

Bitnami Installs on Windows, Mac, and Linux

The Bitnami packages come with v8js already install and running. No further action is necessary.

Manual Installs

Check out the Ubuntu 16.04 instructions for a concrete example.

For all others, we recommend checking out | PHP-V8JS on GitHub.