Is there any way to communicate with ethereum through php ? what i want is to get Smart contract details from contract address like Contract token name, decimal, abi, balance, tokens supply symbols etc. till now what i know is web3.js is a official library to interact with ethereum but there is no implementation in php. I have limitation i cant use js, only option that i have is php. Let me know if there is any web3.js implementation or any other way to interact with smart contract through php.

4 Answers 4


There is currently


and more recently



web3.js doesn't communicate with the Ethereum network directly. Instead, web3.js connects to an Ethereum node running on the user's computer such as Parity, MetaMask, Mist or just geth. This node in turn communicates with the Ethereum network.

You cannot use web3.js with PHP, because it is written in and for JavaScript only. There is no official implementation of web3 in PHP.

You will have to use PHP to communicate with a local Ethereum node. I recommend doing this through its JSON RPC interface. You can find the documentation here:


There's a small library for easily doing this in PHP here, although it is two years old:



After trying some of the php libraries available on Github, I ended publishing my own web3 php library.

Web3-php is a little bit outdated (doesn't support ABIv2) and has problems on transaction signing. And Ethereum-php requires php8 and wasn't an option for me.

Here is what worked for me: https://github.com/drlecks/Simple-Web3-Php


As @Jesse Busman said, not PHP library to use web3 API. Also, using JSON-RPC only will limit your app and make it more complicate for you to code what you really want, which is mostly token interaction. Lot of things you can do with web3 that you cant through JSONRPC!

web3.js is what you look for, and I don't recommend PHP for building ETH Dapp.

  • 1
    Can you explain why don't recommend PHP or is just a personal opinion? Please justify your recommendation.
    – JuliSmz
    Jun 15, 2021 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.