Https request problem whith PAMP. Is https/SSL supported?
Hello,
i have experienced following problem.
I have installed PAMP, including PIPS and SSL.sis
I want to run following script to send sms, from my voip provider website:
[PHP]<?php
$user = "MyUsername";
$password = "MyPassword";
$mainurl = "https://www.voipprovider.com/myaccount/sendsms.php?";
function Send($phone, $msg){
global $user,$password,$url;
$url = 'username='.$user;
$url.= '&password='.$password;
$url.= '&from=username';
$url.= '&to='.urlencode($phone);
$url.= '&text='.urlencode($msg);
$urltouse = $mainurl.$url;
//Open the URL to send the message
$resp = file($urltouse);
echo join("\r\n",$resp);
}
$phonenum = $_POST['recipient'];
$message = $_POST['message'];
Send($phonenum,$message);
?>
[/PHP]
[CODE]
[function.file]: failed to open stream: Invalid argument in ....
[/CODE]
I also try to use fopen($urltouse, 'r');
with the following result:
[CODE]
[function.fopen]: failed to open stream: Invalid argument in ....
[/CODE]
and fsockopen($urltouse);
with following result:
[CODE]
[function.fsockopen] unable to connect to .... (unable to find the socket transport "https" - did you forget to enable it when you configured PHP?)
[/CODE]
And, i cannot find how to enable in php.ini ?!?
Also I try to use cURL, but still not working.
I invoke the https the following way (it`s not the exact code):
[PHP]
<?php
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
if (empty($buffer))
{
print "Sorry, example.com are a bunch of poopy-heads.<p>";
}
else
{
print $buffer;
}
?>
[/PHP]
it`s look almost fine (mobile browser ask to connect), but i always have the sorry message.
Are you tired from reading this :) ?
However I check my phpinfo(); and what I see about cURL is
[CODE]cURL Information libcurl/7.16.2[/CODE]
instead of
[CODE]cURL Information libcurl/7.16.0 OpenSSL/0.9.8e zlib/1.2.3[/CODE]
what is on my desktop web server...
I try to uninstall, and install all the software I need - pips_nokia_1_3_SS.sis, ssl.sis, pamp_1_0_2.sis
And the same problem exists...
It`s all looks that https requests are not supported in PAMP.
Am I right?
I found the decision of my problem using the JavaScript instead of pure PHP, just echoed following:
[CODE]
<script type="text/javascript">
<!--
window.location = "$urltouse"
//-->
</script>
[/CODE]
However I still wondering is this problem exist only for my, or ssl request are not supported.