NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
cURL does not seem to work from the IDE - why?


Joined: 03 Feb 2008
Posts: 42
Reply with quote
Here is my code:

Code:

      $service_url = 'https://my_domain.org/atlas.php?city=' . $this_city . '&cntry=' . $this_state;

      $curl = curl_init($service_url);

      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

      $curl_response = curl_exec($curl);

      curl_close($curl);

      $calc_data1 = json_decode($curl_response, True);         //decode the data so it is usable


The problem is that the IDE never returns anything but False for $curl_response.

curl_getinfo($curl) returns this (instead of the proper data):
: array =
url: string = "https://my_domain.org/atlas.php?city=New Orleans&cntry=Louisiana"
content_type: undefined = NULL
http_code: long = 0
header_size: long = 0
request_size: long = 0
filetime: long = -1
ssl_verify_result: long = 20
redirect_count: long = 0
total_time: double = 0.25
namelookup_time: double = 0.062
connect_time: double = 0.156
pretransfer_time: double = 0
size_upload: double = 0
size_download: double = 0
speed_download: double = 0
speed_upload: double = 0
download_content_length: double = -1
upload_content_length: double = -1
starttransfer_time: double = 0
redirect_time: double = 0
redirect_url: string = ""
primary_ip: string = "66.147.244.170"
certinfo: array =
primary_port: long = 443
local_ip: string = "192.168.2.3"
local_port: long = 51731
http_version: long = 0
protocol: long = 2
ssl_verifyresult: long = 0
scheme: string = "HTTPS"
appconnect_time_us: long = 0
connect_time_us: long = 156000
namelookup_time_us: long = 62000
pretransfer_time_us: long = 0
redirect_time_us: long = 0
starttransfer_time_us: long = 0
total_time_us: long = 250000 )error occurred during curl exec. Additional info:

The script works fine when run on the actual server. Why can't PhpED communicate properly using cURL?
Is there a problem because I am calling "https"?
View user's profileFind all posts by a_edwallSend private message


Joined: 03 Feb 2008
Posts: 42
Reply with quote
UPDATE: I changed both "https" references to "http" and I got a message:

Moved Permanently

The document has moved here.

Then I changed the code back to "https" snd it started working.

Does anyone know the reason for this and what I can do to make it work permanently?

Thank you.
View user's profileFind all posts by a_edwallSend private message
cURL does not seem to work from the IDE - why?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic