我想为 php 安装 v8js 扩展,当我尝试使用此命令安装它时,pecl install v8js
它会在终端显示此日志:
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
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: 20200930
Zend Module Api No: 20200930
Zend Extension Api No: 420200930
Please provide the installation prefix of libv8 [autodetect] :
而且我不知道日志的最后一行是什么意思,Please provide the installation prefix of libv8 [autodetect] :
所以我尝试按回车键跳过它,它继续该过程并显示此日志:
building in /tmp/pear/install/pear-build-mohamedM5SIGk/v8js-2.1.2
running: /tmp/pear/install/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/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... /usr
checking for PHP includes... -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20200930
checking for PHP installed headers prefix... /usr/include/php/20200930
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for V8 Javascript Engine... yes, shared
checking for V8 files in default path... not found
configure: error: Please reinstall the v8 distribution
ERROR: `/tmp/pear/install/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js' failed
但它显示此错误:
configure: error: Please reinstall the v8 distribution
ERROR: `/tmp/pear/install/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js' failed
所以我尝试使用此命令安装 v8 引擎来解决此问题,apt-get install libv8-dev
但它显示以下日志:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libnode-dev' instead of 'libv8-dev'
libnode-dev is already the newest version (12.21.0~dfsg-3ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
在 ubuntu 上正确安装 v8js 的任何帮助!