2016-08-27 22 views
2

私はUbuntuでPHP PhantomをLaravelプロジェクトで使用しようとしています(php version> 5.5)。以下のインストール手順に従ってください:http://jonnnnyw.github.io/php-phantomjs/PHP-PhantomJSでPhantomJSプロシージャを実行するとエラーが発生する

私は次のエラーを取得しています:

Error when executing PhantomJs procedure - File does not exist or is not executable: bin/phantomjs

はさえ$client->setBinDir('/path/public/bin')を使用して、binディレクトリを設定しようとしました。また、両方の絶対および相対パスを試みたが、次のエラーがスローされました:インターネット上で見つけ

Call to undefined method JonnyW\PhantomJs\Client::setBinDir()

試みたすべてがこの問題を解決します。 the docsから

答えて

1

By default the PhantomJS library will look for the PhantomJS executable in the bin folder relative to where your script is running ~/bin/phantomjs. If the executable cannot be found or if the path to your PhantomJS executable differs from the default location, for example you have installed PhantomJS globally, you will need to define the path to your PhantomJS executable manually.

$client->getEngine()->setPath('/path/to/phantomjs');

フォルダが、PhantomJSバイナリファイルへの完全なパスだけでなく、を提供する必要があることに注意してください。

関連する問題