Why to I get this message, what could it be??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why to I get this message, what could it be???

cURL error 56: Recv failure: Connection reset by peer

5th Oct 2017, 3:02 AM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
14 Answers
+ 2
share your code
5th Oct 2017, 4:27 AM
Daniel
Daniel - avatar
+ 1
En local funciona bien
5th Oct 2017, 3:51 PM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
+ 1
usted pudo ejecutar el script?
6th Oct 2017, 7:09 PM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
+ 1
Revisa esta documentacion para ver si este es el problema, dice algo de SOAP, http://arielorozco.com/tutoriales/obtener-tipo-de-cambio-actual-colones-dolares-en-php/
6th Oct 2017, 7:24 PM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
0
Sergio en que tipo de servidor no te funciona?
5th Oct 2017, 10:02 PM
Daniel
Daniel - avatar
0
linux
6th Oct 2017, 1:20 AM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
0
Puro Linux o hosting contratado? cPanel? Plesk? CentOS, Red Hat?
6th Oct 2017, 1:35 AM
Daniel
Daniel - avatar
0
vps Linux
6th Oct 2017, 2:17 AM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
0
Imagino que obviamente debe ser algo con algún tipo de bloqueo del mismo servidor de uno pero no le hemos llegado, entonces aplicamos esa solución
6th Oct 2017, 1:15 PM
Daniel
Daniel - avatar
0
Te pregunto xq hemos tenido la misma situación con BN, solución, jalarlo localmente con una tarea programada y subirlo con el mismo script al servidor mediante cuenta FTP. Después ya la pagina o paginas que necesiten el dato para mostrarlo lo agarran de ese servidor nuestro
6th Oct 2017, 1:16 PM
Daniel
Daniel - avatar
0
no se si eventualmente sera x tratar de hacerlo desde un servidor fuera de CR. Imagino que tu vps es también externo
6th Oct 2017, 1:18 PM
Daniel
Daniel - avatar
0
si, es externo. eso puede ser una razón
6th Oct 2017, 7:08 PM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
0
He impreso en pantalla la petición y el símbolo "&" que concatena las variables se reemplaza por "$amp;". Parece que el web service del BCCR no interpreta ese cambio. será configuración del servidor?
19th Jan 2018, 2:19 AM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
- 1
<?php namespace App\Traits; use GuzzleHttp\Client; // Constantes de tipo de cambio const COMPRA = 317; const VENTA = 318; const EURO = 333; trait TiposDeCambio { public function getExchangeRate($tipo='', $fecha=''){ $fecha_tc = empty($fecha) ? date("d/m/Y") : $fecha; $tipo_tc = empty($tipo) ? VENTA : $tipo; $client = new Client(); $response = $client->get("http://indicadoreseconomicos.bccr.fi.cr/indicadoreseconomicos/WebServices/wsIndicadoresEconomicos.asmx/ObtenerIndicadoresEconomicosXML?tcIndicador=$tipo_tc&tcFechaInicio=$fecha_tc&tcFechaFinal=$fecha_tc&tcNombre=Ns&tnSubNiveles=N",[ ]); $xml = $response->getBody()->getContents(); $xml = simplexml_load_string($xml); $tipo_cambio = trim(strip_tags(substr($xml, strpos($xml, "<NUM_VALOR>"), strripos($xml, "</NUM_VALOR>")))); if ($tipo_cambio !='') { if ($tipo == 333) { $tipo_cambio = number_format($tipo_cambio, 4, '.', ','); }else{ $tipo_cambio = number_format($tipo_cambio, 2, '.', ','); } }else{ $tipo_cambio = 0; } return $tipo_cambio; } } ?>
5th Oct 2017, 3:51 PM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar