在Ubuntu上安装PHPv8js

在Ubuntu上安装PHPv8js,php,embedded-v8,Php,Embedded V8,我在Ubuntu上安装phpv8js时遇到了一些问题 我已经确保安装了最新版本的libv8,并且安装了所需版本的PHP,但是使用PECL安装失败 以下是输出: 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.

我在Ubuntu上安装phpv8js时遇到了一些问题

我已经确保安装了最新版本的libv8,并且安装了所需版本的PHP,但是使用PECL安装失败

以下是输出:

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

我看到的唯一建议是编辑软件包内容以定义PHP_V8_版本,但这似乎有点不成熟:)

您可以键入以下内容,并且应该能够安装v8js for PHP

    sudo apt-get install libv8-dev libv8-dbg g++ cpp
然后键入:

   sudo pecl install v8js-0.1.3
添加到php.ini:

    extension=v8js.so
干杯, 作者:扎克 博客:(http://zaksoftwaredeveloperblog.blogspot.ca)

如果出现错误“包'libv8 dbg'没有安装候选程序”

然后试试看

  • sudo apt get安装libv8 dev g++

  • sudo pecl安装v8js-0.1.3

  • “extension=v8js.so”
    到php.ini
  • 如果您得到“pecl:command not found”,请安装

    php pearpecl的软件包

    sudo apt-get install php-pear php5-dev
    

    然后尝试第2步,你需要更详细地说明你在构建哪个版本,哪个构建系统,你的过程等等。不管怎样。这应该被标记为最佳答案-它对我有用!谢谢0.1.3是一个非常旧的版本,他的发布日期是2012年。然后使用它:
    sudopecl安装v8js-1.3.1
    (发布日期:2016-07-02)我有一个问题,我已经安装了v8js-0.1.3,如果我想要1.3.1,我应该怎么做?
    sudo apt-get install php-pear php5-dev