Not sure, so let's try and figure it out.
Add
//show request
echo $serp->buildRequest().'<br>';
above
//get the response
$serp->getResponse();
in the example.php file and run it again.
You should see the request on the first line, just above the error message, it should look like this...
api.serpstack.com/search?access_key
... key removed}&query=mcdonalds&safe=1
Copy and paste that here (remember to remove your api key to keep it private).
Dave