0

https://github.com/blockchain/api-v1-client-php <== php files im working with.

When i do my first test with this new api i start off with the inits

<?PHP
// Include the autoload.php from its vendor directory
require 'vendor/autoload.php'

// Create the base Blockchain class instance
$Blockchain = new \Blockchain\Blockchain();

// Needed before calling $Blockchain->Wallet or $Blockchain->Create
$Blockchain->setServiceUrl('http://localhost:3000');
?>

But when i do this it says...

"Parse error: syntax error, unexpected '$Blockchain' (T_VARIABLE) in C:\xampp\htdocs\bitcoin\index.php on line 6"

Composer package was compiled correctly and in the root folder.

  • U run the composer already right and under the same folder that the php file is on? – zhiyan114 Feb 4 '18 at 20:24
  • It looks like you just haven't installed it properly, there is definitely a blockchain file (github.com/blockchain/api-v1-client-php/blob/master/src/…) – MeshCollider Feb 4 '18 at 20:36
  • yes i went to my bitcoin folder with src, examples, doc, etc...i held shift and open command window there typed in "composer install" and that was the errors i was getting. check picture of composer error imgur.com/a/JAEgV – BTCDude Feb 4 '18 at 20:36
  • well it looks like i was using a different bitcoin PHP. but the issue is still there, the composer was able to compile fine and i see the blockchain folder and blockchain.php But when i run the script with the same inits its still giving me the exact error for $Blockchain – BTCDude Feb 4 '18 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.