我试图使用PhantomJS,这是我的代码:
<?php
require '../../../../vendor/autoload.php';
use JonnyW\PhantomJs\Client;
$client = Client::getInstance();
$request = $client->getMessageFactory()->createRequest();
$response = $client->getMessageFactory()->createResponse();
$request->setMethod('GET');
$request->setUrl('http://google.com');
$client->send($request, $response);
var_dump($response);
?>但这给了我一个错误:
Fatal error: Uncaught exception 'JonnyW\PhantomJs\Exception\ProcedureFailedException' with message 'Error when executing PhantomJs procedure "default" - File does not exist or is not executable: bin/phantomjs' in /var/www/html/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Procedure/Procedure.php:132 Stack trace: #0 /var/www/html/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Client.php(170): JonnyW\PhantomJs\Procedure\Procedure->run(Object(JonnyW\PhantomJs\Client), Object(JonnyW\PhantomJs\Message\Request), Object(JonnyW\PhantomJs\Message\Response)) #1 /var/www/html/vendor/jonnyw/php-phantomjs/examples/basic-request.php(15): JonnyW\PhantomJs\Client->send(Object(JonnyW\PhantomJs\Message\Request), Object(JonnyW\PhantomJs\Message\Response)) #2 {main} thrown in /var/www/html/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Procedure/Procedure.php on line 132所以它在这条线上崩溃了:
$client->send($request, $response);我尝试了chmod 777所有的\供应商目录和儿童,但什么都不改变,你有主意吗?
发布于 2015-10-18 16:47:43
好的,我只需将链接添加到bin目录中,该目录位于我的项目根目录中。
https://stackoverflow.com/questions/33197118
复制相似问题