php - 使用 PHP 的 exec() 给出错误 : Fatal: [Errno 2] No such file or directory; did you install

标签 php ubuntu web-scraping phantomjs casperjs

我正在尝试使用 PHP exec() 二进制 casperjs,

exec('casperjs /var/www/mysite/application/phantomjs/test.js');

但是我得到了错误

Fatal: [Errno 2] No such file or directory; did you install phantomjs?

CasperJS 运行在 PhantomJS 之上,我在 /usr/local/bin/phantomjs/usr/local/bin/casperjs 手动安装并创建了一个链接>。所以我猜 casperjs 在运行时会调用 phantomjs。

但是当我 ssh 进入服务器并运行时它工作正常

casperjs /var/www/mysite/application/phantomjs/test.js

出了什么问题?我认为 casperjs 不能以网络用户身份运行 phantomjs?如果这是真的,如何解决?

最佳答案

我遇到了完全相同的问题并在这里找到了有效的解决方案:https://groups.google.com/forum/?fromgroups=#!topic/casperjs/92yUM9O0XjA

关于php - 使用 PHP 的 exec() 给出错误 : Fatal: [Errno 2] No such file or directory; did you install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14130311/

相关文章:

php - : how to ajax update the cgridview yii

javascript - 是否可以从虚拟 URL 中提取 var,在元中使用它,但显示原始虚拟 URL?

ubuntu - 安装 snap "core"(3604) ([start snap-core-3604.mount] 失败

c - www-data 调用读取文件的程序

excel - 如何从 btn 类网络抓取中提取属性详细信息

php - ckeditor echo php 变量?

php - 在查询中转义双引号

python - 从 CLion 运行 Python 得到 "Processed finished with exit code 127"

ruby-on-rails - ruby , Mechanize 。如何获取特定的 <a> 标签文本

python - 具有子模式异常的正则表达式模式 (Python)