phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.83k stars 200 forks source link

Test Fail #155

Closed markhughes closed 9 years ago

markhughes commented 9 years ago

After following build instructions on https://github.com/preillyme/v8js/blob/master/README.Linux.md I ran make test all my tests failed. This is a virtualised environment.

Here is a copy of the failed test summary: http://pastebin.com/PhKVZUv8

# php5 --version
PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul  2 2015 15:23:08) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Please let me know what other information I can provide!

markhughes commented 9 years ago

Installing via pecl breaks my php installation as well with a symbol lookup error when I startup:

undefined symbol: _ZTVN6icu_5213UnicodeStringE
rosmo commented 9 years ago

You'll probably need to copy libicui18n.so and libicuuc.so to /usr/lib/x86_64-linux-gnu/ as well.

markhughes commented 9 years ago

Yep, I saw that in the documentation.

/usr/lib/x86_64-linux-gnu/libicuuc.so and /usr/lib/x86_64-linux-gnu/libicui18n.so are already in place

stesie commented 9 years ago

@MarkehMe which version of V8 did you compile? If you use V8 versions more recent than 4.4.9.1 you need to pass snapshot=off to V8 make command. Otherwise V8 immediately segfaults as soon as it is initialized.

With V8 out/x64.release/shell you also find a small sample program from V8 developers, you might want to try whether that one works. If you're affected by the snapshot=off thing the shell won't work neither (without).

Regarding the pecl install and the undefined icu symbols, the V8 library compiles its own ICU version which obviously is incompatible to the one shipped with your system. For it to work you therefore need to copy those .so files -- but you shouldn't overwrite the system ones (most probably other programs would stop to work then). Better copy libv8.so alongside icu & platform to /opt/v8/lib or similar and specify that location to configure explicitly. I.e. --with-v8js=/opt/v8

cheers ~stesie

markhughes commented 9 years ago

Takes me about 3-4 hours to compile on my computer, will get back to you then!

rosmo commented 9 years ago

If you have multiple cores, try passing "-j8" (eg. -j and number of cores you have). That speeds up the compilation quite a bit.

markhughes commented 9 years ago

Awesome! Thank you :smiley:

markhughes commented 9 years ago

@stesie yep - snapshot=off fixed it. Might be worthwhile adding this to the README file?

markhughes commented 9 years ago

I see you did ;) Awesome stuff.