Ich rufe Daten aus einer URL mit Curl ab. Wenn der gleiche Code aus einem PHP CLI -Skript ausgeführt wird, gibt CURL_EXEC false zurück. Die Fehlermeldung ist "Fehler beim Empfangen von Daten aus dem Peer".
Setting curl to verbose gives:
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Last-Modified: Mon, 01 Aug 2011 13:04:59 GMT
< Cache-Control: no-store
< Cache-Control: no-cache
< Cache-Control: must-revalidate
< Cache-Control: pre-check=0
< Cache-Control: post-check=0
< Cache-Control: max-age=0
< Pragma: no-cache
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Type: text/xml
< Transfer-Encoding: chunked
< Date: Mon, 01 Aug 2011 13:04:58 GMT
<
* Trying 153.46.254.70... * Closing connection #0
* Failure when receiving data from the peer
< /code>
Dies ist der Code: < /p>
// if curl is not installed we trigger an alert, and exit the function
if (!function_exists('curl_init')){
watchdog('sixtk_api', 'curl is not installed, api call cannot be executed',array(),WATCHDOG_ALERT);
return $this;
}
// OK cool - then let's create a new cURL resource handle
$ch = curl_init();
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $this->request);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
// Download the given URL, and return output
$output = curl_exec($ch);
if (!$output) {
$error = curl_error($ch);
echo($error);
}
// Close the cURL resource, and free system resources
curl_close($ch);
Ich rufe Daten aus einer URL mit Curl ab. Wenn der gleiche Code aus einem PHP CLI -Skript ausgeführt wird, gibt CURL_EXEC false zurück. Die Fehlermeldung ist "Fehler beim Empfangen von Daten aus dem Peer".[code]Setting curl to verbose gives: < HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Last-Modified: Mon, 01 Aug 2011 13:04:59 GMT < Cache-Control: no-store < Cache-Control: no-cache < Cache-Control: must-revalidate < Cache-Control: pre-check=0 < Cache-Control: post-check=0 < Cache-Control: max-age=0 < Pragma: no-cache < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Content-Type: text/xml < Transfer-Encoding: chunked < Date: Mon, 01 Aug 2011 13:04:58 GMT < * Trying 153.46.254.70... * Closing connection #0 * Failure when receiving data from the peer < /code>
Dies ist der Code: < /p>
// if curl is not installed we trigger an alert, and exit the function if (!function_exists('curl_init')){ watchdog('sixtk_api', 'curl is not installed, api call cannot be executed',array(),WATCHDOG_ALERT); return $this; } // OK cool - then let's create a new cURL resource handle $ch = curl_init();
// Set URL to download curl_setopt($ch, CURLOPT_URL, $this->request);
// Should cURL return or print out the data? (true = return, false = print) curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds curl_setopt($ch, CURLOPT_TIMEOUT, 180);
// Download the given URL, and return output $output = curl_exec($ch); if (!$output) { $error = curl_error($ch); echo($error); }
// Close the cURL resource, and free system resources curl_close($ch); [/code]
Ich habe kürzlich mein Magento von 1.5 auf 1.9 aktualisiert und wann immer ich ein bestimmtes Produkt zum Warenkorb hinzufüge, erhalte ich die Fehlermeldung: 502 Bad Gateway
Es gab keine...
Ich mache meine ersten Schritte mit PHP und bin etwas verwirrt. Ich habe ein kleines Skript geschrieben, das eine POST-Anfrage mit einigen Daten entgegennehmen, die Daten in eine formatierte E-Mail...
Wie senden und empfangen Sie Nachrichten mit Pythons Asyncio und der WebSockets -Bibliothek?
Ich verwende Django -Kanäle als Socket -Server. Im Grunde versuche ich also, diesen Socket -Server zu...