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.

BTCDude
  • 41
  • 6
  • U run the composer already right and under the same folder that the php file is on? – zhiyan114 Feb 04 '18 at 20:24
  • It looks like you just haven't installed it properly, there is definitely a blockchain file (https://github.com/blockchain/api-v1-client-php/blob/master/src/Blockchain.php) – meshcollider Feb 04 '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 https://imgur.com/a/JAEgV – BTCDude Feb 04 '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 04 '18 at 20:43

0 Answers0