PhantomJs PHPJonnyW:无限页面加载

问题描述

我刚才遇到一个问题。 当我使用PhantomJs PHP运行脚本时,包含脚本的页面卡住了。据我了解,它发生在phantomjs将请求发送到网站时(无论如何)。日志是空的,我不知道该怎么办。 我的OC:GNU / Linux(Ubuntu 20.04),apache2。

Code:

<?php

require_once('vendor/autoload.php');

use JonnyW\PhantomJs\Client;

$client = Client::getInstance();
$client->getEngine()->setPath('/var/www/colyt.com/futbal/phantom/bin/phantomjs');
$client->getEngine()->debug(true);

$request = $client->getMessageFactory()->createRequest('https://habr.com/ru/top/','GET');
$response = $client->getMessageFactory()->createResponse();

    // Send the request
$client->send($request,$response); //stucks here

if($response->getStatus() === 200) {

        // Dump the requested page content
    echo $response->getContent();
}

?>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...