First things first: I was given the task to deploy a Drupal website on Azure.
Locally I use OS X running Apache and everything works ok. When I deploy the project to Azure, I get an error. After some debugging I isolated the error to this snippet of code:
private function getToken(){
$ch = curl_init($this->host . $this->clientId . "&client_secret=" . $this->clientSecret);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json',));
$response = json_decode(curl_exec($ch));
curl_close($ch);
$token = $response->access_token;
dvm($response, $name = NULL);
return $token;
}
dvm()
is a Drupal Devel function, but suffice to say that's sort of print_r
for Drupal on steroids.
The problem I'm getting is that for whatever reason, $result
is coming back NULL
. When I run the same code on my local machine and on a Linux/Debian box, all worked as expected (I get an Object as a result of the curl
).
This leads to the conclusion that Azure is not liking something in this piece code. The problem is finding out what. Any ideas?