Installing V8 JavaScript Engine and V8js PECL extension on Ubuntu 14

This is much more like a note to self than an instructional guide. If you need to install the latest version V8 JavaScript Engine and V8JS lib for php, you’ll need to compile them from source. (If you’re using Ubuntu 14, the APT repositories have a very old version of those libraries. If those versions are ok for you, just use apt-get to install libv8 and pecl to install the v8js lib for PHP.)

First download, compile and “install” V8 from Google

svn checkout ./v8
 cd v8
 make builddeps
 make native library=shared

sudo mkdir -p /usr/lib /usr/include
 sudo cp out/native/*.so /usr/lib/
 sudo cp -R include/* /usr/include
sudo cp out/native/*.so /usr/lib/x86_64-linux-gnu/
 echo -e "create /usr/lib/libv8_libplatform.a\naddlib out/native/\nsave\nend" | sudo ar -M

Then install v8js via pecl

sudo pecl install v8js-0.4.0 # The latest stable version for PHP 5+ at the time of this writing

Now add to your php.ini.

Deixe uma resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *