Installing PHPv8js on Ubuntu
Asked Answered
S

2

10

I'm having some trouble installing phpv8js on Ubuntu.

I've made sure I have a recent version of libv8 installed and have the required version of PHP but the install fails using PECL.

Here's the output:

libtool: compile:  g++ -I. -I/tmp/pear/temp/v8js -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootFyySRS/v8js-0.1.2/include -I/tmp/pear/temp/pear-build-rootFyySRS/v8js-0.1.2/main -I/tmp/pear/temp/v8js -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/v8js/v8js.cc  -fPIC -DPIC -o .libs/v8js.o
/tmp/pear/temp/v8js/v8js.cc:100: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:100: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:100: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8Js___construct(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:569: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8Js_executeString(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:667: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8Js_getPendingException(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:748: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void php_v8js_persistent_zval_ctor(zval**)’:
/tmp/pear/temp/v8js/v8js.cc:770: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void php_v8js_persistent_zval_dtor(zval**)’:
/tmp/pear/temp/v8js/v8js.cc:783: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8Js_registerExtension(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:848: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8Js_getExtensions(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:876: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void php_v8js_create_exception(zval*, v8::TryCatch*)’:
/tmp/pear/temp/v8js/v8js.cc:1004: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1008: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1011: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1018: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1022: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8JsException_getJsFileName(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:1060: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1060: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8JsException_getJsLineNumber(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:1065: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1065: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8JsException_getJsSourceLine(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:1070: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1070: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zim_V8JsException_getJsTrace(int, zval*, zval**, zval*, int)’:
/tmp/pear/temp/v8js/v8js.cc:1075: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1075: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘int zm_startup_v8js(int, int)’:
/tmp/pear/temp/v8js/v8js.cc:1135: error: ‘PHP_V8_VERSION’ was not declared in this scope
/tmp/pear/temp/v8js/v8js.cc:1145: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1146: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1147: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc:1148: warning: deprecated conversion from string constant to ‘char*’
/tmp/pear/temp/v8js/v8js.cc: In function ‘void zm_info_v8js(zend_module_entry*)’:
/tmp/pear/temp/v8js/v8js.cc:1231: error: ‘PHP_V8_VERSION’ was not declared in this scope
/tmp/pear/temp/v8js/v8js.cc: At global scope:
/tmp/pear/temp/v8js/v8js.cc:1276: warning: deprecated conversion from string constant to ‘char*’
make: *** [v8js.lo] Error 1
ERROR: `make' failed

The only suggestions I've seen are to edit the package contents to define PHP_V8_VERSION but that seems a little hacky :)

Swanhildas answered 14/10, 2011 at 16:23 Comment(1)
You need to detail a little better which versions you are building against, and which build system, your procedure, etc. It's tricky business anyway.Fendley
S
25

You can type the following and you should be able to install v8js for php.

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

Then type:

   sudo pecl install v8js-0.1.3

Add to php.ini :

    extension=v8js.so

Cheers, Contributed By: Zak Blog: (http://zaksoftwaredeveloperblog.blogspot.ca)

Supplementary answered 1/12, 2012 at 2:0 Comment(3)
This should be marked as best answer - it worked for me! Thanks!Shoemake
0.1.3 is kinda very old version, his date was released from year 2012. Then use it: sudo pecl install v8js-1.3.1 (relased date: 2016-07-02)Kapp
i have a question, i have already installed v8js-0.1.3 what should i do if i want 1.3.1?Manizales
O
3
sudo apt-get install libv8-dev libv8-dbg g++ cpp

if you are getting error "Package 'libv8-dbg' has no installation candidate".

Then Try.

  1. sudo apt-get install libv8-dev g++

  2. sudo pecl install v8js-0.1.3

  3. "extension=v8js.so" to to your php.ini

if you are getting "pecl: command not found" then install

php-pear package for the pecl

sudo apt-get install php-pear php5-dev

and try step 2

Ovenbird answered 8/12, 2015 at 6:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.