here is my configuration : Apache2 working with php7.1.
I have an example PHP code for sending a sms message specific to JasminSMS :
<?php
// Sending simple message using PHP
// http://jasminsms.com
$baseurl = 'http://127.0.0.1:1401/send'
$params = '?username=foo'
$params.= '&password=bar'
$params.= '&to='.urlencode('+336222172')
$params.= '&content='.urlencode('Hello world !')
$response = file_get_contents($baseurl.$params);
?>
But it does not working and give me error 500.
I have two examples that works well:
http://127.0.0.1:1401/send?username=foo&password=bar&to=06222172&content=hello
and
curl -d "username=foo&password=bar&dlr=yes&dlr-level=3&to=xxxxxxxxxx&from=InfoMessage&dlr-url=http://exemple.com/dlr.php&content=hello !" http://127.0.0.1:1401/send
I need to turn them into php queries and found them next exemples :
<?php
$ch = curl_init("http://127.0.0.1:1401/send");
$fp = fopen("username=foo&password=bar&dlr=yes&dlr-level=3&to=xxxxxxxxxx&from=InfoMessage&dlr-url=http://exemple.com/dlr.php&content=hello !", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>
<?php
$ch = curl_init('http://127.0.0.1:1401/send?username=foo&password=bar&to=xxxxxxxxxx&content=hello !');
curl_exec ($ch);
curl_close ($ch);
?>
that I found here :
Sending POST form data with php CURL, api-http-examples-php and I tested all these examples without result, all show me 500 error.
Maybe it needs to configure .htaccess, my file permissions are 755 with www-data.
Thanks for any help.