<p><a href="https://github.com/blockchain/api-v1-client-php" rel="nofollow noreferrer">https://github.com/blockchain/api-v1-client-php</a> &lt;== php files im working with.</p>

<p>When i do my first test with this new api i start off with the inits</p>

<pre><code>&lt;?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-&gt;Wallet or $Blockchain-&gt;Create
$Blockchain-&gt;setServiceUrl('http://localhost:3000');
?&gt;
</code></pre>

<p>But when i do this it says...</p>

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

<p>Composer package was compiled correctly and in the root folder.</p>

CC BY-SA 3.0
2018-02-04T20:24:06.607Z
U run the composer already right and under the same folder that the php file is on?
zhiyan114
CC BY-SA 3.0
2018-02-04T20:36:41.480Z
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
CC BY-SA 3.0
2018-02-04T20:36:59.850Z
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
CC BY-SA 3.0
2018-02-04T20:43:23.647Z
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
<php>
blockchain api missing file?
BTCDude
# blockchain api missing file?

(Asked by: username_0 on 2018-02-04)

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
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.

**Tags:** php

> **Comments:**
> **username_1**: U run the composer already right and under the same folder that the php file is on?  
> **username_2**: 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)  
> **username_0**: 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  
> **username_0**: 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  

---

## 0 answers

