2

I have using sms gateway api on my server

$live_url = "http://sms6.routesms.com:8000/bulksms/bulksms?username=XXX&password=XXX&type=1&dlr=0&destination=XXX&source=routesms&message=CurlSecond";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $live_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);

For this,

if i do var_dump(curl_exec($ch));, It is showing false

if i do var_dump(curl_getinfo($ch));, It is showing like

array(26) { ["url"]=> string(153) "http://sms6.routesms.com:8000/bulksms/bulksms?username=XXX&password=XXX&type=1&dlr=0&destination=XXX&source=routesms&message=CurlSecond" ["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0) ["request_size"]=> int(0) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(62.345893) ["namelookup_time"]=> float(0.08692) ["connect_time"]=> float(0) ["pretransfer_time"]=> float(0) ["size_upload"]=> float(0) ["size_download"]=> float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(-1) ["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["certinfo"]=> array(0) { } ["primary_ip"]=> string(0) "" ["primary_port"]=> int(0) ["local_ip"]=> string(0) "" ["local_port"]=> int(0) ["redirect_url"]=> string(0) "" }

What i have to do?

I can't understand the issue?

I have tried one more way, Instead of curl, i have used

file($live_url);

This is also not working

Deen
  • 611
  • 2
  • 16
  • 30
  • The first thing you should do is add error handling to your code. Take a look into the documentation, that _always_ is helpful: http://php.net/manual/de/function.curl-error.php – arkascha Jul 08 '15 at 11:21

1 Answers1

-1

Please cross check is curl is installed on your server, if curl is not installed try following.

If it is ubontu server RUN

sudo apt-get install php5-curl

Restart Your Server

sudo service apache2 restart

Alternatively, if you are using php-fpm, you'll need to restart php5-fpm instead

sudo service php5-fpm restart

Hope this works ...

Samit Khulve
  • 154
  • 6