Reputation: 1
I'm new to PHP, and I was trying to run
$exampleBase.php
from web3.php on mac
but it keeps showing error :
PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found in /Users/hsnl/Desktop/code/back-end-php/web3.php/examples/exampleBase.php:7 Stack trace: #0 {main} thrown in /Users/hsnl/Desktop/code/back-end-php/web3.php/examples/exampleBase.php on line 4
$exampleBase.php
file is like this
<?php
require('vendor/autoload.php');
use Web3\Web3;
$web3 = new Web3('http://localhost:8545/');
any idea why or how should I fix this?
Upvotes: 0
Views: 968
Reputation: 66
If you are trying to run sc0Vu, please try to follow this steps: https://github.com/sc0Vu/web3.php#local-php-cli-installed
Clone the repo and install packages.
git clone https://github.com/sc0Vu/web3.php.git && cd web3.php && composer install
This means:
Run test script.
vendor/bin/phpunit
Upvotes: 1