PhantomJS:curl:(22)请求的URL返回错误:404 Not Found

时间:2017-06-08 01:52:32

标签: php curl phantomjs

尝试通过brew安装phantomjs,收到此错误

  

==>正在下载https://github.com/ariya/phantomjs/archive/2。       已下载:/ Library/Caches/Homebrew/phantomjs-2.0.0.tar.gz       ==>正在下载https://gist.githubusercontent.com/mikemcquaid/db645f7cbeec4f3b1b2e/raw/e664ecc5c259344d5a73a84b52e472bf8ad3733

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "phantomjs--patch"
Download failed: https://gist.githubusercontent.com/mikemcquaid/db645f7cbeec4f3b1b2e/raw/e664ecc5c259344d5a73a84b52e472bf8ad3733e/phantomjs-yosemite.patch

1 个答案:

答案 0 :(得分:0)

在Ubuntu上安装PhantomJS

首先,安装或更新最新的系统软件。

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev

安装PhantomJS所需的这些软件包才能正常工作。

sudo apt-get install libfreetype6 libfreetype6-dev
sudo apt-get install libfontconfig1 libfontconfig1-dev

从PhantomJS网站获取。

cd ~
export PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2

下载后,将Phantomjs文件夹移至/ usr / local / share /并创建符号链接:

sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin

现在,它应该在您的系统上正确使用PhantomJS。

phantomjs --version