Foros del Web » Programando para Internet » PHP »

Call to undefined function curl_init() in

Estas en el tema de Call to undefined function curl_init() in en el foro de PHP en Foros del Web. Hola tengo este codigo y me da el siguiente error Fatal error: Call to undefined function curl_init() in C:\wamp\www\poker\api.php on line 8 Código PHP: <?php ...
  #1 (permalink)  
Antiguo 22/09/2008, 11:28
 
Fecha de Ingreso: junio-2008
Mensajes: 292
Antigüedad: 15 años, 10 meses
Puntos: 4
Call to undefined function curl_init() in

Hola tengo este codigo y me da el siguiente error
Fatal error: Call to undefined function curl_init() in C:\wamp\www\poker\api.php on line 8

Código PHP:
<?php

  
include "API.php";  // API $url and $pw values set here

  // Fetch the Site Name using the SystemGet API command.

  
$params "123456=" $pw "&Command=SystemGet&Property=SiteName";
  
$api Poker_API($url,$params);
  
$result $api["Result"];
  if (
$result == "Error") die("Error: " $api["Error"]);
  
$sitename $api["Value"];

  
// Fetch the list of players using the AccountsList API command.

  
$params "123456=" $pw "&Command=AccountsList&Fields=Player,Balance";
  
$api Poker_API($url,$params);
  
$result $api["Result"];
  if (
$result == "Error") die("Error: " $api["Error"]);

  
// Iterate through the players in the response and create a associative
  // chips array keyed on player name.

  
$accounts $api["Accounts"];
  
$chips = Array();
  for (
$i 1$i <= $accounts$i++)
  {
    
$player $api["Player" $i];
    
$chips[$player] = $api["Balance" $i];
  }

  
// Sort array in decending order.

  
arsort($chips);

  
// Display results in an html table.

  
echo "<table border='1' cellpadding='5'>\r\n";
  echo 
"<tr><th colspan='3'>$sitename - Chip Leaders</th></tr>\r\n";
  echo 
"<tr><th>Rank</th><th>Player</th><th>Balance</th></tr>\r\n";
  
$rank 0;
  
$total 0;
  foreach (
$chips as $p => $c)
  {
    
$rank++;
    
$total += $c;
    echo 
"<tr><td>$rank</td><td>$p</td><td>$c</td></tr>\r\n";
  }
  echo 
"<tr><td colspan='2'>Total chips</td><td>$total</td></tr>\r\n";
  echo 
"</table><br>\r\n";

?>
he estado mirando y es que me falta la libreria curl, pero he modificado el php.ini y copiado los archivos a system pero sigue dandome el error espero que alguien me pueda ayudar, un saludo y gracias.
  #2 (permalink)  
Antiguo 22/09/2008, 11:35
Avatar de Synkronice  
Fecha de Ingreso: octubre-2007
Ubicación: Madrid
Mensajes: 831
Antigüedad: 16 años, 6 meses
Puntos: 48
Respuesta: Call to undefined function curl_init() in

Tienes instalado o habilitado el modulo cURL en PHP??

Saludos!!
  #3 (permalink)  
Antiguo 22/09/2008, 12:23
 
Fecha de Ingreso: junio-2008
Mensajes: 292
Antigüedad: 15 años, 10 meses
Puntos: 4
Respuesta: Call to undefined function curl_init() in

lo habilite en php.ini quitandole ;
  #4 (permalink)  
Antiguo 22/09/2008, 12:49
Avatar de DooBie  
Fecha de Ingreso: septiembre-2004
Mensajes: 1.101
Antigüedad: 19 años, 7 meses
Puntos: 71
Respuesta: Call to undefined function curl_init() in

Después de quitarle el ; has reiniciado el servidor web?

Por cierto, por lo que parece, el error lo tienes en el fichero que incluyes "API.php" y no en el código que has puesto.
  #5 (permalink)  
Antiguo 31/10/2008, 16:45
 
Fecha de Ingreso: octubre-2008
Mensajes: 1
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: Call to undefined function curl_init() in

Saludos
Para poder Instalar curl en Xampp solo tienes que descomentar la siguiente linea
extension=php_curl.dll
en los siguientes archivos

c:/xampp/php/php.ini

c:/xampp/php/php5.ini

c:/xampp/apache/bin/php.ini

c:/xampp/php/php4/php4.ini

c:/xampp/php/php4/php.ini


Reinicia Apache

Listo con esto deberia funcionar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:14.