Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install V8js on PHP5.5?

Tags:

php

ubuntu

v8

libv8

I want to install the v8js extension for PHP5.5 on Ubuntu 12.04 but can't make it working.

When I try to install the v8js extension version 0.2.0 (latest) with PECL, I have this message:

configure: error: libv8 must be version 3.24.6 or greater ERROR: `/tmp/pear/temp/v8js/configure --with-v8js' failed

If I try to install an old version, I have a compilation error. This message is very similar to my issue: Install v8js for php on ubuntu

How can I fix this issue?

EDIT: I couldn't install it on Ubuntu 14.04 with PHP5.5, even with a PHP downgrade with PHPbrew to PHP 5.4. However, using Ubuntu 12.04 with PHP 5.4 works great. I didn't try the downgrade from PHP 5.5 to 5.4 on Ubuntu 12.04.

like image 644
Guillaume Renoult Avatar asked Mar 24 '15 09:03

Guillaume Renoult


2 Answers

in case you can't find libv8-dev or libv8-dbg, you can find the correct version by run command

~$ apt-cache search libv8
libv8-3.14-dbg - V8 JavaScript engine - debugging symbols
libv8-3.14-dev - V8 JavaScript engine - development files for 3.14 branch
libv8-3.14.5 - V8 JavaScript engine - runtime library
libv8-dev - V8 JavaScript engine - development files for latest branch

then you can run

~$ sudo apt-get install libv8-3.14-dev libv8-3.14-dbg g++ cpp

then you can try to install v8js via pecl by running

~$ sudo pecl install v8js-0.2.0

if that command return error like this

configure: error: libv8 must be version 3.24.6 or greater
ERROR: `/tmp/pear/temp/v8js/configure --with-v8js' failed

you can try to install v8js-0.1.3 instead by running

~$ sudo pecl install v8js-0.1.3

then edit your php.ini to add v8js extension

~$ echo "extension=v8js.so" >> /etc/php5/cli/php.ini
like image 121
Reyhan Sofian Haqqi Avatar answered Oct 18 '22 17:10

Reyhan Sofian Haqqi


  1. Open your terminal/console

  2. sudo apt-get install libv8-dev libv8-dbg g++ cpp

  3. Make an update sudo apt-get update

  4. Try sudo pecl install v8js-0.2.0 (or other version i.e.: sudo pecl install v8js-0.1.3)

  5. Edit your php.ini (Check: Where is my php.ini file?) file by adding: extension=v8js.so.

  6. Restart server

If it the extension still doesn't work, try to edit /etc/php5/conf.d/v8js.ini and add extension=v8js.so and restart server again.

Hope this helps.

like image 32
NETCreator Hosting - WebDesign Avatar answered Oct 18 '22 16:10

NETCreator Hosting - WebDesign