를로드하지,하지만 난PHPPhantomJS 내가 페이지를로드 PHP PhantomJS를 사용하는 것을 시도하고있다 PhantomJS 모듈
Fatal error: Uncaught JonnyW\PhantomJs\Exception\ProcedureFailedException: Error when executing PhantomJs procedure - File does not exist or is not executable: bin/phantomjs in /Volumes/WWW ROOT/namechase/www/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Procedure/Procedure.php:138
Stack trace:
#0 /Volumes/WWW ROOT/namechase/www/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Client.php(162): JonnyW\PhantomJs\Procedure\Procedure->run(Object(JonnyW\PhantomJs\Http\Request), Object(JonnyW\PhantomJs\Http\Response))
#1 /Volumes/WWW ROOT/namechase/www/crawling.php(30): JonnyW\PhantomJs\Client->send(Object(JonnyW\PhantomJs\Http\Request), Object(JonnyW\PhantomJs\Http\Response))
#2 {main}
thrown in /Volumes/WWW ROOT/namechase/www/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Procedure/Procedure.php on line 138
이 단지 내 테스트 도메인 중 하나, 그리고 다른 한편으로 발생하는 오류를 얻을.
두 도메인에서 실행중인 코드는 동일하지만 두 테스트 베드 중 하나에서 작동하지 않습니다. 둘 다 서로 다른 가상 호스트를 사용하는 동일한 시스템에서 실행되지만 하나만 오류를 리턴합니다.
require $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
echo '<pre>';
use JonnyW\PhantomJs\Client;
$client = Client::getInstance();
$delay = 5; // 5 seconds
$request = $client->getMessageFactory()->createRequest('https://google.com', 'GET');
$request->setDelay($delay);
/**
* @see JonnyW\PhantomJs\Http\Response
**/
$response = $client->getMessageFactory()->createResponse();
// Send the request
$client->send($request, $response);
if($response->getStatus() === 200) {
// Dump the requested page content
echo $response->getContent();
}
나는
"config": {
"bin-dir": "/usr/local/bin"
}
를 사용하여 composer.json
파일에 phantomjs
의 경로를 설정 시도했지만이 당신의 패키지를 설치하는 차이를