Practical overview
When it fits
Use it when a PHP application needs read access to Ethereum through an available JSON-RPC endpoint, including contract reads or event and block monitoring.
Who it is for
- PHP developers integrating Ethereum reads into applications.
- Developers building contract-event listeners or block-by-block indexing utilities.
- Developers who want a PHP client for smart-contract read calls or contract tests.
Documented uses
- Retrieve information from an Ethereum blockchain through JSON-RPC.
- Call supported smart-contract functions that do not require payment.
- Watch contract changes or process blocks for indexing.
- Use a PHP client when testing smart contracts.
Requirements & limits
The project is a public, MIT-licensed repository. The README specifies PHP 7.1 or later and shows Composer installation.
- The application must provide an Ethereum JSON-RPC endpoint; the README's connection example uses a local Ganache endpoint.
- Contract calls use ABI and deployed-address metadata, with Truffle compilation output given as an example.
- The library does not support signing transactions for blockchain writes.
- The README says that not all data types are supported.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Connect a PHP application to an Ethereum JSON-RPC endpoint
Install the library and make a documented JSON-RPC request using an endpoint URL.
Before you start
- PHP 7.1 or later
- Composer
- An Ethereum JSON-RPC endpoint URL
Steps
Install the package with Composer using
composer require digitaldonkey/ethereum-php.Load Composer's
vendor/autoload.phpfile and importEthereum\Ethereum.Create an Ethereum instance with the endpoint URL, then call a method such as
eth_protocolVersion()and read its value withval().
Expected outcome
The PHP application can request the protocol version from the configured endpoint.
Guide limitations
- The library is read-only and does not support signing transactions for blockchain writes.
- Not all data types are supported.
Call a smart contract read method
Use contract metadata and an Ethereum endpoint to call an unpriced contract function.
Before you start
- PHP 7.1 or later and Composer
- An Ethereum JSON-RPC endpoint URL
- Contract ABI and deployed address, such as those in Truffle compilation metadata
Steps
Load the contract ABI and deployed address from the contract metadata.
Create a
SmartContractinstance with the ABI, address and anEthereumconnection.Call a contract method and read the returned value with
val().
Expected outcome
The application can read the result of a supported contract function that does not require payment.
Guide limitations
- The library is read-only and does not support signing transactions for writes.
- Not all data types are supported.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- digitaldonkey/ethereum-php · Official homepage title · retained in its source language

