I have a ip cam and I use Get method to switch on the alarm.
When I use browser everything is ok
http://da***.com:808/set_alarm.cgi?user=***&pwd=***&motion_armed=1"
If a try to use this php file I always obtain "504 gateway time out"
<?php
function httpGet($url)
{
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
$output=curl_exec($ch);
curl_close($ch);
return $output;
}
echo httpGet("http://da***.com:808/set_alarm.cgi?user=***&pwd=***&motion_armed=1");
?>
Can someone help me?
Thanks
Best Answer
I think you are requesting some script from the same server, and
504
is likely due to only one PHP backend process, So when you request from browser its only one request and is getting server.If you are using php-cgi, configuring environment variable before starting php-cgi, hope it helps.
Check that your backend can handle multiple requests simultaneously and that your script doesn't somehow create a dead-look (requesting the output of itself).
Check FCGI logs. If that doesn't help, increment the debug levels on nginx.