I am having a problem Here
<?php
include('smsconfig.php');
include("SMTPconfig.php");
include("dbconnect.php");
define("SITE_URL", "http://gf2fyu.blah.com");
$GLOBAL_REST_URL = "gf2fyu.domain.com/organization/";
$headers = array(
'X-MYDOMAIN-Secret:VuFlRQv40SUp0y1AXflMD0hWw8ZiiTu08f9ZXc0AYFc=',
'Content-Type: application/json; charset=UTF-8',
'Accept: application/json; charset=UTF-8',
);
//$json = array2json($ages);
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,$GLOBAL_REST_URL);
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
// curl_setopt($curl_handle, CURLOPT_POSTFIELDS,$json);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
$getit = json_decode($buffer, true);
$smskey = substr(number_format(time() * rand(),0,'',''),0,5);
print_r($getit);
?>
The above code working fine for me if i am running it on my local server and mozila REST
client but whenever i am trying to put this code on production version
this code is not hitting the rest server .
Please tell me what is the problem here ?
I am using the same header in MOzila also it is working fine
I am running Nginx
file_get_contents()?curlis disabled and you're getting an error. Try commenting out thecurlcode to see if page loads.cURLwithfile_get_Contentsgood idea (lot of servers haveallow_url_wrappersdisables).curl:) I'm offering an alternative for testing.