有下一个问题:在 MAMP 上安装了 php phantomjs。从这里制作所有使用说明:在此处输入链接描述
一切正常...然后我将所有站点文件复制到我的网络托管站点文件夹中,但没有任何效果。做了一个 var_dump 的响应并看到:
object(JonnyW\PhantomJs\Http\Response)#156 (8) { ["headers"]=> NULL ["status"]=> NULL ["content"]=> NULL ["contentType"]=> NULL [" url"]=> NULL ["redirectURL"]=> NULL ["time"]=> NULL ["console"]=> NULL }
为什么它不起作用,为什么一切都是NULL?我的代码是:
require __DIR__ . '/vendor/autoload.php';
use JonnyW\PhantomJs\Client;
$client = Client::getInstance();
$request = $client->getMessageFactory()->createRequest('http://jonnyw.me', 'GET');
$response = $client->getMessageFactory()->createResponse();
var_dump($response);
$client->send($request, $response);
echo $response->getContent();