Skip to content

Error 500 while reading daemon's response #11

@davidebaldini

Description

@davidebaldini

From jsonRPCClient.php, line 132:

                if ($fp = fopen($this->url, 'r', false, $context)) {                                                                           
                        $response = '';                                                                                                        
                        while($row = fgets($fp)) {                                                                                             
                                $response.= trim($row)."\n";                                                                                   
                        }                                                                                                                      
                        $this->debug && $this->debug.='***** Server response *****'."\n".$response.'***** End of server response *****'."\n";  
                        $response = json_decode($response,true);                                                                               
                } else {                                                                                                                       
                        throw new Exception('Unable to connect to '.$this->url);                                                               
                } 

the exception is thrown by simply invoking $ php5 index.php from the console.
The output I get is;

$ php5  index.php
PHP Warning:  fopen(http://...@localhost:8332): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
 in /var/www/pluscoin/jsonRPCClient.php on line 132
<!DOCTYPE html>
<html lang='en'>
<head>
        <meta charset='utf-8'>
... /* etcetera */

The credentials are set and the daemon is running. Fore reference, with curl I get:

$ curl http://...@localhost:8332
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}

The getbalance lines from index.php are modified as suggested here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions