我无法从php-phantom获取任何数据它不能与我合作 当我尝试使用php-phantom获取源页面时,我在php_log文件中发现此错误 这是完整的代码
require 'vendor/autoload.php';
use JonnyW\PhantomJs\Client;
$client = Client::getInstance();
$client->getEngine()->setPath('/home/XXXXXXX/public_html/bot/bin/');
$client->getEngine()->debug(true);
var_dump($client->getLog());
$request = $client->getMessageFactory()->createRequest();
$response = $client->getMessageFactory()->createResponse();
$request->setMethod('GET');
$request->setUrl('http://jonnyw.me');
$client->send($request, $response);
if($response->getStatus() === 200) {
echo $response->getContent();
}
答案 0 :(得分:0)
尝试@ini_set('zlib.output_compression', 'off');