Processing
 

How to install V8js on PHP5.5?

24/03/2015 09:35#1

grenoult

Member

Joined at: 9 months ago

Post: 2

Thank: 0

Thanked: 0

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.

12/12/2015 12:42Top#2

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

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 
18/06/2015 14:07Top#3

Joined at: 9 months ago

Post: 4

Thank: 0

Thanked: 0

  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.

24/06/2016 21:22Top#4

Joined at: 9 months ago

Post: 2

Thank: 0

Thanked: 0

These other answers work well and I used v8js-0.1.3 for the past 1.5 years but after needing to upgrade to PHP 7 I needed a better solution as v0.1.3 doesn't compile with PHP 7 (something to do with php_smart_str being renamed to php_smart_string).

After a couple hours of frustrating research and compiling libv8 myself, I didn't want to have to go through this whole process on every server I provisioned.

Anyway, I found this site which points you to a launchpad PPA site that provides a couple different ubuntu packages with the 5.1 and 5.2 libv8 libraries.

I ran these commands (please don't add repositories of 3rd party devs without understanding the risks).

sudo apt-add-repository ppa:pinepain/libv8-5.2 sudo apt-get update sudo apt-get install libv8-5.2-dev sudo pecl install v8js-1.1.0 

(Thanks @JeyKeu for suggesting to add "apt-get update" to these commands)

I couldn't get v8js-1.3.0 or 1.2.0 to build, but 1.1.0 worked well. I checked the changelog and found that the latest updates are not necessary in my circumstance anyway.

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 140

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 138

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 5

Build artifacts over ssh jenkins - PHP

2 years ago - Reply: 1 - Views: 37

Can't load Metasploit after installation

2 years ago - Reply: 5 - Views: 212

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 96

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 118

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 248

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 110

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re