Cannot connect web3 php to ropsten test network

Hi, im a bit confused to connect my web3 php (laravel) with ropsten.
I successfully connect ganache blockchain to web3 php, this is some source code in laravel controller

 public function DecetralizeID(){
 $contractABI = //[{*some abi*}]

$contract = new Contract('', $contractABI);
$contractAddress = "0xc17E4f191Fb9000262698eE4cDDE8bF66bFb6AA3";
$fromAccount = "0x9cdc1E3F896dD416660b7359A0bC81EAE5e1b93a"; //accounts[0] -

$contract->at($contractAddress)->call("showLogsByOwner", $fromAccount, function($err,$data) {
  if ($err !== null) {
    echo 'Error: ' . $err->getMessage();
  echo 'showLogsByOwner : show id logs by address user :<br>';
  foreach ($data as $dt) {
      foreach($dt as $t) {
        echo $t;
        echo "<br>";


This worked perfectly, I can echo the function showLogsByOwner within the blockchain. The problem is how to connect it with ropsten test net.
i did this but failed, I change this line ::

$contract = new Contract('', $contractABI);

to this

$contract = new Contract('', $contractABI);

Then i run laravel again and I got error :
cURL error 28: Operation timed out after 1000 milliseconds with 0 out of 0 bytes received (see for

is there something I missing or what? please need your help

I also posted this issue on stackoverflow

hi @alvin , can you try a simple curl from the same machine and see if that works:

-H “Content-Type: application/json”
-d ‘{“jsonrpc”:“2.0”,“method”:“eth_blockNumber”,“params”: [],“id”:1}’

hi @traian.vila , I try the curl, the result is I got error curl invalid json request(windows powershell) but in linux and postman, i got succesfull result

but thats not the main problem. the main problem is I can connect to ropsten with web3php, do you have some tutorials for this case ?

Yes, I was trying to exclude a connection issue, it sounds like a timeout problem. Try increasing the 1s default timeout and see how it goes:

:grinning:thanks sir, you save my life

1 Like