I can not show output of curl.I use phpstorm with Xampp and echo dose not work. output in Browser in
502 Bad Gateway
<?php
$execution_time_limit = 25000;
set_time_limit($execution_time_limit);
header('Content-type: text/html; charset=utf-8');
$url="https://stackoverflow.com/questions/ask";
$data = getPage($url);
echo $data;
function getPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_BUFFERSIZE, 5555500);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
first got to:
C:\xampp
and do that:
- Just Run "xampp-control.exe" as administrator
- and stop apache service action port.
- and tick this(in snapshot) check box it will ask for install as service just install it
- then click start
Integrating XAMPP with the IDE:
We can add the one we've installed with XAMPP by clicking the Browse button (…). This will bring up the Interpreters dialog box.