-
-
Save CyJimmy264/ec5dbb4e375d1a56c1f2753891fda71e to your computer and use it in GitHub Desktop.
Install V8js php extension on ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update -o Acquire::ForceIPv4=true | |
sudo apt-get install -y build-essential chrpath git -o Acquire::ForceIPv4=true | |
cd /tmp | |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
export PATH=`pwd`/depot_tools:"$PATH" | |
fetch v8 | |
cd v8 | |
make native library=shared -j8 | |
chrpath -r '$ORIGIN' out/native/lib.target/libv8.so | |
sudo mkdir -p /tmp/v8-install/lib /tmp/v8-install/include | |
sudo cp out/native/lib.target/lib*.so /tmp/v8-install/lib/ | |
sudo cp -R include/* /tmp/v8-install/include | |
echo -e "create /tmp/v8-install/lib/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend" | sudo ar -M | |
cd /tmp | |
git clone https://github.com/preillyme/v8js.git | |
cd v8js | |
phpize | |
./configure --with-v8js=/tmp/v8-install | |
make | |
make test | |
sudo make install | |
echo "extension=v8js.so" > /etc/php/7.0/mods-available/v8js.ini | |
ln -s /etc/php/7.0/mods-available/v8js.ini /etc/php/7.0/cli/conf.d/20-v8js.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the line : make native library=shared -j8
gives the error : 'No rule to make target 'native'