在Ubuntu上安装v8js扩展给PHP使用
在Ubuntu上安装v8js扩展给PHP使用
我如何在Ubuntu 12.04上安装v8js?
我看到了以下问题:安装Ubuntu上的PHPv8js
当我使用针对php 5.4.23编译的v8js-0.1.3时,我遇到了错误:
/usr/lib/php5/20100525# php -m | grep v8js
PHP警告:PHP启动:无法加载动态库'/usr/lib/php5/20100525/v8js.so' - /usr/lib/php5/20100525/v8js.so: undefined symbol: _ZN2v87Integer3NewEi in Unknown on line 0
可能的原因是:它为php 5.3(20090626)编译的v8js。我将其用于php 5.4(20100525)。
编译v8js-0.1.5时,我遇到的错误如下(通过gcc4.8):
运行:make
/bin/bash /tmp/pear/temp/pear-build-rootHtv6O2/v8js-0.1.5/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/v8js -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootHtv6O2 /v8js-0.1.5/include -I/tmp/pear/temp/pear-build-rootHtv6O2/v8js-0.1.5/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 -c /tmp/pear/temp/v8js/v8js.cc -o v8js.lo
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
make: *** [v8js.lo] Ошибка 1
错误:'make'失败
通过gcc 4.7:
运行:make
...
/usr/include/v8.h:5091:24: note: v8::Context::Scope::Scope(v8::Handle
/usr/include/v8.h:5091:24: note: no known conversion for argument 1 from 'v8::Persistent
/usr/include/v8.h:5089:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5089:9: note: no known conversion for argument 1 from 'v8::Persistent
/tmp/pear/temp/v8js/v8js.cc:1103:32: error: 'GetCurrent' is not a member of 'v8::Context'
/tmp/pear/temp/v8js/v8js.cc:1106:21: error: 'NewSymbol' is not a member of 'v8::String'
make: *** [v8js.lo] Ошибка 1
错误:'make'失败
我如何正确安装它?谢谢。