Skip to content
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

在 OS X 上安裝 v8js #5

Open
JeffKko opened this issue Feb 12, 2019 · 0 comments
Open

在 OS X 上安裝 v8js #5

JeffKko opened this issue Feb 12, 2019 · 0 comments
Labels
Javascript javascript Mac OS X This issue or pull request already exists PHP

Comments

@JeffKko
Copy link
Owner

JeffKko commented Feb 12, 2019

安裝 brew (有裝過 brew 可以跳過此步驟)

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安裝 v8

brew install v8

安裝 v8js

安裝 PECL

參考此篇文章

從 github 下載 v8js 安裝包並安裝

 cd ~ 
 mkdir tmp && cd tmp
 git clone https://github.com/phpv8/v8js
 cd v8js
 phpize
 ./configure CXXFLAGS="-Wno-c++11-narrowing"
 make
 make test #if this step fails you can try to install anyway. should work.
 make install

如果在 make install 步驟跳出 operation not permitted 錯誤的話
需要按這篇文章來解除封鎖

如果遇到 'php.h' file not found 的錯誤, 需要重新安裝 common line tool 和 SDK

xcode-select --install
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

安裝成功之後 在 php.ini (/etc/php.ini) 裡面加入內容

extension=v8js.so

重新啟動 Apache

sudo apachectl graceful

之後可以輸入以下指令確認 v8js 是否安裝成功

php -i | grep v8js

或是直接開啟 phpinfo 看看有沒有 v8js 擴充套件的資訊

參考

1

@JeffKko JeffKko added Javascript javascript Mac OS X This issue or pull request already exists PHP labels Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Javascript javascript Mac OS X This issue or pull request already exists PHP
Projects
None yet
Development

No branches or pull requests

1 participant