0

我们一直在尝试在我们的服务器上安装 v8js:

服务器详情

操作系统:CentOS Linux 7 (Core) CPE 操作系统名称:cpe:/o:centos:centos:7 内核:Linux 3.10.0-042stab141.3 架构:x86-64

我们使用 php 7.4

我们已经尝试了许多在线找到的方法,包括使用 WHM,但这就是发生故障的地方:

(在终端...)

    **ea-php74-pecl install v8js**

输出:

    ''' downloading v8js-2.1.2.tgz ...
    Starting to download v8js-2.1.2.tgz (102,977 bytes)
    ........................done: 102,977 bytes
    28 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20190902
    Zend Module Api No:      20190902
    Zend Extension Api No:   320190902
    Please provide the installation prefix of libv8 [autodetect] :
    building in /root/tmp/pear/pear-build-rootl3thYo/v8js-2.1.2
    running: /root/tmp/pear/v8js/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config --with-v8js
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for pkg-config... /bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking target system type... x86_64-pc-linux-gnu
    checking for PHP prefix... /opt/cpanel/ea-php74/root/usr
    checking for PHP includes... -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-        php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib
    checking for PHP extension directory... /opt/cpanel/ea-php74/root/usr/lib64/php/modules
    checking for PHP installed headers prefix... /opt/cpanel/ea-php74/root/usr/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for gawk... gawk
    checking for V8 Javascript Engine... yes, shared
    checking for V8 files in default path... found in /usr/local
    found in /usr
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking how to run the C++ preprocessor... g++ -E
    checking for C standard version... c++11
    checking how to allow c++11 narrowing...
    **checking for libv8_libplatform... configure: error: could not find libv8_libplatform library
    ERROR: `/root/tmp/pear/v8js/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config --with-v8js' failed ''**'

我们还尝试了“ea-php74-pecl install v8”,它输出:

    downloading v8-0.2.2.tgz ...
    Starting to download v8-0.2.2.tgz (199,055 bytes)
    ....................done: 199,055 bytes
    122 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20190902
    Zend Module Api No:      20190902
    Zend Extension Api No:   320190902
    building in /root/tmp/pear/pear-build-root1CuGGg/v8-0.2.2
    running: /root/tmp/pear/v8/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for pkg-config... /bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking target system type... x86_64-pc-linux-gnu
    checking for PHP prefix... /opt/cpanel/ea-php74/root/usr
    checking for PHP includes... -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib
    checking for PHP extension directory... /opt/cpanel/ea-php74/root/usr/lib64/php/modules
    checking for PHP installed headers prefix... /opt/cpanel/ea-php74/root/usr/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for gawk... gawk
    checking for V8 Javascript Engine... yes, shared
    checking Check for supported PHP versions... supported (7.4.25)
    checking for V8 files in default path... found in /usr
    checking for ICU data file icudtl.dat... checking for V8 version... cat: /usr/include/v8-        version.h: No such file or directory
    cat: /usr/include/v8-version.h: No such file or directory
    cat: /usr/include/v8-version.h: No such file or directory
    cat: /usr/include/v8-version.h: No such file or directory
    cat: /usr/include/v8-version.h: No such file or directory
    /root/tmp/pear/v8/configure: line 4081: test: -gt: unary operator expected
    /root/tmp/pear/v8/configure: line 4082: test: -gt: unary operator expected
    ..
    ****configure: error: libv8 must be version 6.6.313 or greater****
    ERROR: `/root/tmp/pear/v8/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config' failed

请问有什么想法吗?我们花了几天时间试图让这个运行......

编辑这些说明是我们一直遵循的,以及这些

我已经设法通过将此目录添加到服务器来修复指示它找不到 libv8_libplatform 库的错误。所以,现在当我尝试运行时:

ea-php74-pecl install v8js 

我收到了这个错误:

downloading v8-0.2.2.tgz ...
Starting to download v8-0.2.2.tgz (199,055 bytes)
...........done: 199,055 bytes
122 source files, building
running: phpize
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
building in /root/tmp/pear/pear-build-rootZge4Us/v8-0.2.2
running: /root/tmp/pear/v8/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/root/tmp/pear/pear-build-rootZge4Us/v8-0.2.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
ERROR: `/root/tmp/pear/v8/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config' failed
4

1 回答 1

0

该消息error: libv8 must be version 6.6.313 or greater表明您安装的任何 V8 都太旧了。看起来CentOS 7 官方只提供 3.14,这已经过时了。

快速浏览一下,似乎v8js 指令应该可以解决问题。他们将指导您自己下载和构建 V8。

如果这不起作用,请更具体地说明您尝试了什么。显然,“在网上找到的许多方法”不是一个非常精确的描述。

于 2021-11-18T18:53:15.683 回答