Title: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: adamcol on January 01, 2014, 05:05:44 PM Hoping someone has an answer to this rather strange issue.
I've got bitcoind running, and connected to my web service via rpc. Commands like this work fine: Code: require_once 'jsonRPCClient.php'; As soon as I use any command that passes two or more arguments, it dies full stop with no errors or anything. Debug.log claims a connection timeout. Eg: Code:
I've tried using single quotes, double quotes, no quotes, an array, and a different server.. Any ideas? Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: elbandi on January 01, 2014, 05:19:12 PM catch the exception!
Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: aceat64 on January 01, 2014, 10:59:50 PM The jsonRPCClient library uses fopen() and will throw an exception saying "Unable to connect" if it receives a 404 or 500 error from bitcoind. This prevents you from being able to see error messages generated by bitcoind (as they are sent with status 404 or 500).
I wrote a replacement for jsonRPCClient specifically for Bitcoin, if you run into any issues with it let me know: https://github.com/aceat64/EasyBitcoin-PHP Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: BCB on January 01, 2014, 11:04:04 PM adamcol, does event he first of the three cmd's succeed or do they all fail?
Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: aceat64 on January 05, 2014, 09:48:16 PM Try using var_dump instead of echo. The output of getinfo() should be an array.
Code: $bitcoin = new Bitcoin('bitcoinrpc','AJ2sa2cgGh2sVKUBuUCdALCcfNsM2VbLf37pmKEX7Xh3', '99.233.34.168','51337', 'http'); Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: gweedo on January 05, 2014, 09:51:38 PM Did you add
Code: allowip=<ip you are connecting from> in your bitcoin.conf file. Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: gweedo on January 05, 2014, 10:07:23 PM Try using var_dump instead of echo. The output of getinfo() should be an array. Code: $bitcoin = new Bitcoin('bitcoinrpc','AJ2sa2cgGh2sVKUBuUCdALCcfNsM2VbLf37pmKEX7Xh3', '99.233.34.168','51337', 'http'); Hey - I get a bool(false) with that PHP command. Yes 0 in php means false, when not casted. Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: aceat64 on January 05, 2014, 10:50:38 PM Do you have the curl extension installed? I haven't tested to see how the script behaves without it.
Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: chiznitz on January 09, 2014, 03:46:28 PM I won't get into my overall issues but I'm having the same issue with easybitcoin.php not placing the error into bitcoin->error.
It returns 0 no matter how I print it. var_dump($bitcoin2->error); print_r($bitcoin2->error); I broke the address on purpose, when I fix the address it works just fine the curl dll is installed for php, however I am running on windows during development. Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: aceat64 on January 15, 2014, 12:53:50 AM I've reworked my library to make more sense and fixed some major bugs. Namely, I wasn't handling things well if cURL ran into an issue.
Title: Re: PHP, jsonRPClient, bitcoind - Not able to pass multiple parameters Post by: Shahrukh on January 15, 2014, 10:11:59 AM Did you restart bitcoin daemon after making changes? Nothing will be effected until you restart bitcoind
|