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?
If you are trying to run sc0Vu, please try to follow this steps: https://github.com/sc0Vu/web3.php#local-php-cli-installed
This means:
vendor/bin/phpunit