user3768725
user3768725

Reputation:

JSON-RPC PHP class not found error

I am using this php wrapper for multichain's json rpc api: https://github.com/Kunstmaan/libphp-multichain in a php file.

I'm not sure how I should adjust my code and I'm reluctant to adjust the libraries so I wanted to check this understanding:

<?php
   require_once 'libphp-multichain/src/be/kunstmaan/multichain/MultichainClient.php';
   require_once 'libphp-multichain/src/be/kunstmaan/multichain/MultichainHelper.php';
   $client = new MultichainClient("http://107.170.46.124:port",{usr},{pwd});
   print_r($client);

The error I see in apache error log is:

PHP Fatal error: Class 'MultichainClient' not found in /var/www/html/new.php on line 5

Previously I had the wrong question on here which was referring to a php error treating MultichainClient as a function

Upvotes: 1

Views: 826

Answers (1)

Jeff Puckett
Jeff Puckett

Reputation: 40981

this is not a function, you're trying to declare an instance of a new class object. so add the new keyword

$client = new MultichainClient("multichainrpc","password","host","port",3);

Upvotes: 3

Related Questions