-
Notifications
You must be signed in to change notification settings - Fork 202
Error: could not find libv8_libplat form library - Installing v8JS PHP extension #380
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
Comments
v8js versions >= 1.0.0 target PHP 7; if you really still want to go with PHP 5, the latest version you can use is 0.6.4 ... however this one doesn't work with recent V8 versions also. (at least your build output shows api version 20121212, which is PHP 5.5, ... so if you actually want to use PHP 7, then your pecl/phpize calls were wrong) |
Hi @stesie Thanks for your help I'm using vagrant and I installed
And whe I run And I'm trying to install latest version of Then why its throws me error that I'm using php5? Sorry for asking question again, but I'm new to v8js. Thanks |
So far I can only guess what you're doing, since you haven't said much regarding your setup (apart from some package version numbers available from screen output). So you seem to have some PHP 5.5 around (otherwise paths like So there's also the package version So to me it seems like Which version of V8 do you have installed? And particularly where to? That all being said, you'll likely want to continue like this (if you really need the version mess):
... you can leave off the path to libv8 if it is installed to /usr (i.e. /usr/include and /usr/lib) Mind how the correct version of phpize and php-config are referenced |
Echoing @stesie here, make sure you have libv8 installed in either You can build libv8 from Google source (it takes like 2 hours to build) or install from here - https://launchpad.net/~pinepain/+archive/ubuntu/libv8 for Ubuntu (unfortunately, it does not have build for 14.04). For example on how to build for source, you can look at this: https://github.com/niiknow/docker-hostingbase/blob/master/FULL.md - use Once you have libv8, either:
Example, I copied my installation from Tip/Summary, you can see if you have libv8 installed for use with
It must resolve at one of the two location. |
using |
Yeah, you would not have libv8.so on macOS from brew install. You may need to modify |
Instruction how I got it to work:
$ brew list v8
/usr/local/Cellar/v8/7.4.288.25/bin/d8
/usr/local/Cellar/v8/7.4.288.25/libexec/include/ (21 files)
/usr/local/Cellar/v8/7.4.288.25/libexec/ (7 files)
$ ls -la /usr/local/Cellar/v8/7.4.288.25/libexec
total 71392
drwxr-xr-x 10 tomn staff 320 May 21 16:10 .
drwxr-xr-x 10 tomn staff 320 May 21 15:36 ..
-rwxr-xr-x 1 tomn staff 329556 May 21 15:36 d8
-rw-r--r-- 1 tomn staff 10326064 Apr 19 13:45 icudtl.dat
drwxr-xr-x 20 tomn staff 640 Apr 19 13:45 include
-rwxr-xr-x 1 tomn staff 3554732 May 21 15:36 libicui18n.dylib
-rwxr-xr-x 1 tomn staff 2053864 May 21 15:36 libicuuc.dylib
-rwxr-xr-x 1 tomn staff 19945340 May 21 15:36 libv8.dylib
-rwxr-xr-x 1 tomn staff 193012 May 21 15:36 libv8_libbase.dylib
-rwxr-xr-x 1 tomn staff 131744 May 21 15:36 libv8_libplatform.dylib
$ mkdir -p /usr/local/Cellar/v8/7.4.288.25/libexec/lib
$ cp /usr/local/Cellar/v8/7.4.288.25/libexec/* /usr/local/Cellar/v8/7.4.288.25/libexec/lib
cp: /usr/local/Cellar/v8/7.4.288.25/libexec/include is a directory (not copied).
cp: /usr/local/Cellar/v8/7.4.288.25/libexec/lib is a directory (not copied).
$ ls -la /usr/local/Cellar/v8/7.4.288.25/libexec
total 71392
drwxr-xr-x 11 tomn staff 352 May 21 16:11 .
drwxr-xr-x 10 tomn staff 320 May 21 15:36 ..
-rwxr-xr-x 1 tomn staff 329556 May 21 15:36 d8
-rw-r--r-- 1 tomn staff 10326064 Apr 19 13:45 icudtl.dat
drwxr-xr-x 20 tomn staff 640 Apr 19 13:45 include
drwxr-xr-x 9 tomn staff 288 May 21 16:12 lib
-rwxr-xr-x 1 tomn staff 3554732 May 21 15:36 libicui18n.dylib
-rwxr-xr-x 1 tomn staff 2053864 May 21 15:36 libicuuc.dylib
-rwxr-xr-x 1 tomn staff 19945340 May 21 15:36 libv8.dylib
-rwxr-xr-x 1 tomn staff 193012 May 21 15:36 libv8_libbase.dylib
-rwxr-xr-x 1 tomn staff 131744 May 21 15:36 libv8_libplatform.dylib
$ git clone https://github.com/phpv8/v8js
$ cd v8js
$ git checkout php7
$ phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
$ php --version
PHP 7.2.18 (cli) (built: May 2 2019 13:05:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
with Zend OPcache v7.2.18, Copyright (c) 1999-2018, by Zend Technologies
$ ./configure CXXFLAGS="-Wno-c++11-narrowing" --with-v8js="/usr/local/Cellar/v8/7.4.288.25/libexec"
$ make
...
$ make test
...
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 65
---------------------------------------------------------------------
Number of tests : 177 174
Tests skipped : 3 ( 1.7%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 174 ( 98.3%) (100.0%)
---------------------------------------------------------------------
Time taken : 22 seconds
=====================================================================
...
$ make install
Installing shared extensions: /usr/local/Cellar/php@7.2/7.2.18/pecl/20170718/
$ ls -la /usr/local/Cellar/php@7.2/7.2.18/pecl/20170718/
total 1648
drwxr-xr-x 4 tomn admin 128 May 21 16:05 .
drwxr-xr-x 3 tomn admin 96 May 7 10:21 ..
-rwxr-xr-x 1 tomn admin 551692 May 21 16:05 v8js.so
-rw-r--r-- 1 tomn admin 287020 Oct 25 2018 xdebug.so Above are instructions from my MacBook Pro 15 (mid 2015), macOS High Seria 10.13.6, php 7.2, Homebrew 2.1.3 NOTE: I've historically compile v8js on linux. I never had a need to build v8 on macOS so I never tried. Once @palfaro91 hinted of |
@noogen Pretty straight forward if you are familiar with these tools, not so much if you are following the Side note... on the readme, is the |
@palfaro91 Actually, I meant to give kudos the author on having it working for macOS. It's because I also had a tough time, in the past, trying to build on linux - especially with php 7.3; that I decided not to even try on my macOS. Since I'm familiar with docker, I just do all related work inside of docker. Anyway, instruction is pretty old and it said to checkout version 3.32.6. If you look at older version of v8, you will find a In newer version, we use python tools to build, hence no more You can look here if you're interested in full build script (in linux) - https://github.com/niiknow/docker-hostingbase/blob/master/v8build/Dockerfile#L38 |
@noogen I'm most likely going to have to set this up on a linux server so thanks for sharing that build script. Hope this thread helps someone in the future. |
@noogen I've tried your installation procedure, unfortunately I got this error. ➜ v8js git:(php7) make My setup is: ➜ ~ sw_vers ➜ ~ php -v ➜ ~ pecl version Any idea? Thank you! |
@Jiri-Mihal that's because the latest v8 (7.5.288.22) from homebrew deprecated a bunch of stuff. I tested latest v8 (7.5.288.22) on Mojave and got the same error as you. Try uninstall your v8 Note, I've also successfully compile phpv8/v8js on latest macOS Mojave 10.14.5 and php 7.3.6 using v8 7.4.288.25 |
@noogen thank you a lot, it really helped. Finally I installed v8js on macOS Mojave with PHP 7.3. Here are steps I followed, It could help to others: Installing v8
Installing v8js extension
Enabling v8js in PHP
|
Back again... @noogen @Jiri-Mihal |
@palfaro91 unfortunately, I've only use brew installation to run php-fpm and nginx on OSX so I'm not familiar with Apache setup on OSX. Though, a google search on your error show that it's something new in Mojave security that require library to be validated before it can be run on the default Apache. As a result, the standard recommendation is to uninstall MacOs provied Apache and PHP and installing them through Brew. ref: https://superuser.com/questions/1363013/apache-cant-load-php-unsigned-extensions-on-mac-os-mojave |
@palfaro91 I use Nginx and PHP installed through Homebrew. I’ve never used Apache and PHP provided by macOS. |
@palfaro91 I'm having a similar issue, please comment if you find a solution. I'll do the same, but i'm losing all hope after 3 days of bashing my head against a wall
|
@palfaro91 Due to changes in Mojave that required signing of *.so files, I'd suggest you remove and reinstall mojave bottles (especially), php, nginx, and v8js (need new bottles compilation). Again, you want to Note, bottles also require you to have Mojave updated xcode (may need to re-accept license). You can see that v8 compile dependent on bottles https://github.com/Homebrew/homebrew-core/blob/0a6171330678879285f2c566db9349da421d6f62/Formula/v8.rb#L8 @kklon Your issue maybe different. It's not finding the v8js.so file so it maybe a php.ini things. If you also did an upgrade from High Seria to Mojave, then you want to also |
V8 7.5 should work since yesterday night. Please give it another try. @noogen would you also want to file a PR with updates to README.MacOS.md file/instructions? |
@Jiri-Mihal you made my day ! |
@Jiri-Mihal thank you so much, I was dying on my keyboard, watching V8js compilation errors... |
thank you so much :) Follow your instruction, installed successfully. I am on macOS Catalina.
|
@Jiri-Mihal thank you for your step by step instruction. The key here is the right v8 version and proper v8 lib folder layout installed on the mac. After that, use pecl install v8js may make the following step easier. :) |
For me had to execute below commands as well
|
I'm trying to install php v8js extension but stuck with an issue:
Here is the terminal data:
Can you please help me.
Thanks in advance, cheers
The text was updated successfully, but these errors were encountered: