-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This LIB is very hard to install ! #522
Comments
Followed : https://github.com/phpv8/v8js/blob/php8/README.Linux.md Error :
|
Hi, you are right, installing of v8js on modern versions of PHP is confusing because the documentation is not up to date. On the other hand, the latest version available in PECL specifies that it does not support php8: https://pecl.php.net/package-changelog.php?package=v8js&release=2.1.2 I was able to install v8js on php 8.2.9 after a few minutes examining the config.m4 file and my old v8js installation on php 7.2. Here is an installation guide for debian bookworm and php 8.2.9. v8 library installation: apt install libnode-dev After installation it is necessary to copy the files with the structure needed by v8js for compilation: mkdir /opt/v8
mkdir /opt/v8/lib
mkdir /opt/v8/includes copy v8 files from /usr/lib/x86_64-linux-gnu/, to /opt/v8js/lib. ls /opt/v8/lib
libnode.so libnode.so.108 libv8.so libv8_libbase.so libv8_libplatform.so libv8_libsampler.so copy v8 includes from /usr/include/v8 to /opt/v8/include cp -r /usr/include/v8/* /opt/v8/include/ Installing v8js cd /opt/
git clone https://github.com/phpv8/v8js.git cd v8js
phpize
./configure --with-v8js=/opt/v8 LDFLAGS="-lstdc++"
make
make test
make install Then add extension=v8js.so to your php.ini file |
thanks, it's work for me with php8.0 |
Thank you very much ! before posting this message, i was frustrated because i have spent a lot of time trying to install this library. I finally succeeded few hours after this message, in another way that your way. But your way is easier and better. I encountered many compilation errors, one was because the prototype of a function mismatch between the v8 lib and this lib. So i take my courage at two hands and decided to edit the C code by myself to fix the prototype. And after recompiling, it worked. But thanks for considering my message and to give to everyone a working and easy solution. I'm sure that it will help a lot of people. |
@jcastilloa do you know how to do with CentOS 7? |
@art-fatal, I think so, try installing the packages nodejs-libs and nodejs-devel to provide the v8 library and the includes |
@tbarillet did you manage to install it on CentOS? |
@art-fatal I managed to install it on CentOS 7 + remi, dm me if you need help. |
FWIW this is why I created https://github.com/joehoyle/php-v8js which is a re-implementation of this lib. V8 is included directly on the pre-built php extension so there's no need to mess around with trying to install libv8 on the system |
@joehoyle i get that you’re trying to help but using issues as a means to divert people away from a project kinda feels a tad awkward and not really in the spirit of open source projects |
Perhaps you’d be ok to paste the details here? Then we can probably update the documentation for others :) |
I was able to get this building on Alpine 3.19 by installing the You can see the changes I made to v8js for this here — I just replaced various references to the various v8 libraries in It would be nice to make this something that could be merged back — i.e., update the autoconf logic such that it autodetects and links with either libv8 or libnode, depending on which is present — but I don't know autoconf well enough to really make that change (and don't have the time needed to learn it). |
@Westacular I guess you could open a PR with the changes |
Here's how my Dockerfile looks like, this example is with php 8.3 and Debian 12. https://gist.github.com/dinamic/60a573e6ffa8749f94931a4d7cfcfcb8 |
Why is this lib so difficult to install? Why do we have to do dozens of manipulations/builds just to install this extension? Why libv8-dev and pecl install v8js are not enough!
It's crazy, there are almost no resources on the internet to install this library on recent versions of PHP (like 8.1 or 8.2) or on recent operating systems (Ubuntu 22+, CentOS) what a hassle !
After dozens of attempts, I still haven't succeeded, hell you have to have a doctorate in software engineering to install this lib! What hell ?
Can you do something and give clear and complete instructions on how to install this lib on php 8.2 and Ubuntu 22.04 for example?
The text was updated successfully, but these errors were encountered: