I installed bitoind and synced it. But when i'm trying to connect from my php website i getting: Unable to connect to http://user:[email protected]:18332/. Also when i'm trying to see password through command

bitcoin-cli -stdinrpcpass getblockchaininfo

it returns

could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/blockchain/.bitcoin/bitcoin.conf).

My bitcoin.conf file is setted and works nice


2 Answers 2


I found I had to copy the contents of ~/.bitcoin/bitcoin.conf into /etc/bitcoin/bitcoin.conf because that's what's being used when bitcoind starts on boot up. I put my user and password in that file, rebooted, and bitcoin-cli worked again.

Also try adding

bitcoin-cli -stdinrpcpass getblockchaininfo -rpcuser user -rpcpassword password
  • Also strange thing, when i trying for exaple to change rcp port by bitcoin-cli -rpcport 8332, it's like setting to 0 and returns "Could not connect to the server" Commented Mar 9, 2019 at 16:57
  • Do you want to run testnet or mainnet? 18332 is the testnet port. 8332 is mainnet. You have testnet=0 which maybe should be testnet=1? Commented Mar 9, 2019 at 17:31
  • first of all i tried testnet, but it didn't work the same. You know, i solved the problem, but with not finally correct method. I used command: bitcoind --daemon -rpcuser=user -rpcpassword=password -txindex -rpcallowip= -rpcallowip= -rpcport=8332. It works, but i don't think this method is ok. Commented Mar 9, 2019 at 17:43

maybe it works when you change rpcallowip=* to rpcallowip=

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.