bitcoind API sendrawtransaction error 500
You cannot send one transaction twice. If you have already sent it from bitcoin commandline, then it will fail with -22(cli) or 500(http) error.

500 means incorrect data: insufficient funds, bad syntax, bad type, impossible command...

Try to cast to string: $bitcoin -&gt; sendrawtransaction((string)$tx_data), and do var_dump($tx_data) to find the type.

If it doesn't help, send this POST request from cURL, as in tutorial: https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Command_line_.28cURL.29