Skip to main content

Questions tagged [php]

Questions regarding the use of the PHP scripting language with Ethereum.

Filter by
Sorted by
Tagged with
12 votes
4 answers
14k views

web3 js php implementation

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 ...
Talha Malik's user avatar
11 votes
1 answer
17k views

PHP Library for Ethereum

I am looking for a PHP library to interact with Ethereum. Are there any active open source projects of PHP libraries for Ethereum available? Thanks for your help
Bumblebee's user avatar
  • 1,761
10 votes
2 answers
3k views

How can I trigger a PHP script when a transaction is received?

My goal is to have a PHP script be invoked whenever a transaction is received by a given address. I know Javascript but this is my first sally into Node.js. I think the right approach is to run a ...
spraff's user avatar
  • 645
5 votes
1 answer
3k views

Accepting and sending API for Ethereum

Is there any good API for accepting and sending Ethereum like blocktrail for bitcoin ? Why is working with Ethereum so complicated?
Rahul's user avatar
  • 51
5 votes
1 answer
2k views

How can I do abi.encodePacked in Python or PHP?

Just concatenating strings doesn't work. Keccak::hash(10 . $address, 256) is what I'm doing atm.
good_evening's user avatar
5 votes
1 answer
5k views

How to generate Ethereum address in PHP?

I am working on a web application where I need to generate Ethereum addresses in PHP, how do i go about generating a random Ethereum public/private key pair in PHP? thanks.
Daniel Valland's user avatar
5 votes
1 answer
954 views

How to send an ETH address from a webpage to a smart contract?

What's the best way to get an ETH address from a website form submission (php) passed to a smart contract in order that the smart contract can send some new minted Tokens to the ETH address collected ...
BenH70's user avatar
  • 91
4 votes
2 answers
2k views

Create signed message without JSON RPC node in PHP

I am trying to recreate effect of web3's eth.accounts.sign in PHP and I struggle to find good resources how to do it properly. I have seen this (found it thanks to this thread) and based on what I ...
Gall Annonim's user avatar
4 votes
1 answer
2k views

Ethereum address genеration and keccаk256

I'm trying to generate eth address on PHP. Having issue with keccak256. I'm using this class: https://github.com/kornrunner/php-keccak It works good, I checked many times on https://emn178.github.io/...
toptrader's user avatar
4 votes
1 answer
4k views

Generate Ethereum address from a private key

My question was first asked on stackoverflow but due lack of privileges I couldn't move it here directly. I am trying to generate an Ethereum address based on a given private key following this "How ...
H Aßdøµ's user avatar
3 votes
1 answer
12k views

Find out latest block hash in Ethereum using JSON-RPC

I am developing an ethereum block explorer in PHP and have established an JSON-RPC communication with my server geth node successfully. Nevertheless, I am kind of stuck when trying to find out the ...
Juan Ignacio Pérez Sacristán's user avatar
3 votes
2 answers
1k views

Why doesn't my verification of a signed message signature work in PHP?

I am attempting to verify a signed message in PHP. To be clear, I am not looking to interface with JSON-RPC or any external service, which I both a) know works and b) successfully verifies the ...
EvilJordan's user avatar
3 votes
3 answers
14k views

How to fetch ETH/USD price from the coinmarketcap api

I want to fetch the current ETH-USD price from this api (https://api.coinmarketcap.com/v1/ticker/ethereum/?convert=USD). How do I fetch just the price into a variable in PHP for reuse on my ...
optimalresource's user avatar
3 votes
1 answer
3k views

How can I sign a message off-chain and verify it in the contract method that it was signed by a specific address?

I have a public / private keys. I release a contract with these keys. I want some user to withdraw a token / ether, so I sign some message like {withdraw: 10, nonce:1} offchain. User uses this signed ...
good_evening's user avatar
2 votes
1 answer
1k views

Ethereum Transaction Using cUrl and web3.php, I get a Receipt but the Transaction is not sent to the Network

This has been doing my head in all day, after wading through and managing to get all my values converted to hex I create and sign the ethereum transaction using the web3p/ethereum-tx library from ...
Corey's user avatar
  • 21
2 votes
1 answer
3k views

Ethereum-PHP Calling contract function with parameter

I'm not the author of Ethereum part but have to connect to using php. Choosen Ethereum-PHP package (https://github.com/digitaldonkey/ethereum-php). Have connection to ethereum and smart contract but ...
Tom B's user avatar
  • 33
2 votes
1 answer
7k views

Interact with MetaMask via PHP

I can easily interact with metamask via web3 js like this (JS): web3 = new Web3(web3.currentProvider); Is it possible to interact with metamask via php? For example (PHP): $ethereum = new Ethereum('...
Marc Alexander's user avatar
2 votes
1 answer
106 views

Why there is no private key in sending transaction code in Web3.php?

I want to use Web3.php so that I send contract transaction to Ethereum blockchain. I use the following code: $web3 = new Web3('... node address ...'); $contract = new Contract($web3->provider, $...
Alireza Zojaji's user avatar
2 votes
1 answer
244 views

What are the best tools or ways to interact with a smart contract from a word-press website?

I am currently working on a WordPress website and I want to interact with a deployed smart contract and need help selecting the right tools or ways to interact.
leycun's user avatar
  • 133
2 votes
1 answer
2k views

Failed RLPx handshake

I am trying to use https://github.com/kesar/ethereum-php on the back-end of my web site. I followed a tutorial http://iotbl.blogspot.ca/2017/03/setting-up-private-ethereum-testnet.html to set up two ...
user avatar
2 votes
2 answers
3k views

transactions through a php website [closed]

how I use to users to send ethereum transactions through a php website?My server is Apache. Is the Ethereum JavaScript API useful to doing this? Thank you!
user16572's user avatar
2 votes
0 answers
485 views

ethereum-php library SmartContract balanceOf always returns 0

I am trying to check balance of some USDT token using ethereum-php library but it always return 0. Here is the code, $contractMeta = json_decode('[{"constant":true,"inputs":[],"name":"name","...
Gagandeep Singh's user avatar
2 votes
0 answers
87 views

Ethereum js wallet for php

https://github.com/ethereumjs/ethereumjs-wallet I need this library with the same functions in PHP Would u give me the link
FreeJoyMan's user avatar
2 votes
1 answer
723 views

Recovered Sender Address from Raw Transaction

I'm trying this code example : https://thomasclowes.com/verifying-an-ethereum-signature-on-the-server-php-2/ Expected $recoveredSenderAddress = 0xd5bfc359c3a377bb8afd41db8ffc8d1349718233 Actual $...
vincentLg's user avatar
  • 281
2 votes
0 answers
1k views

How to transfer tokens from smart contract using PHP?

I want to transfer tokens using PHP script and that script will be executed using cronjob, is there library available to transfer by unlocking account using private key?
Kamran Jabbar's user avatar
2 votes
2 answers
2k views

web3 js eth.contract equivalent in PHP

var Web3 = require('web3'); var web3 = new Web3(); web3.setProvider(new web3.providers.HttpProvider("http://blahblah.com:8545")); var token = web3.eth.contract(ABI).at("x0x_contract_address") How ...
Marc Alexander's user avatar
1 vote
1 answer
3k views

Save hash data with KECCAK-256 then reverse the process in PHP

I am saving data hashed with keccak-256 in Solidity and I am trying read that data with PHP, but cant seem to find any good solutions. I can get PHP to read off the data but I cant arrive at the same ...
Dino Anastos's user avatar
1 vote
1 answer
1k views

Infura getLogs returns an empty result

I'm writing a crypto based system with PHP on Infura, and now I am coding a script to retrieve logs for a specific address. This is my code: $ch = curl_init($my_server_url); $data = array( '...
Mohammad Saberi's user avatar
1 vote
2 answers
7k views

How to transfer ETH between two addresses using geth and json rpc

I have geth running on my server. I am building a php website which act as wallet. Now iam able to create addresses. I need to be able to deposit and withdraw ETH between addresses on same node. I ...
SMJ's user avatar
  • 157
1 vote
1 answer
567 views

Why does some of the DAPP uses PHP and how would they do so?

I always wonder how come many DAPPS uses PHP extension at the end of the filename and how did they do so ?? There is slighlty possibility that they are using the Web3PHP library to interact with the ...
developer base's user avatar
1 vote
1 answer
2k views

Invalid sender when sending Raw Transaction, signed w/ ethereum-tx on PHP

I am using PHP and ethereum-tx library https://github.com/web3p/ethereum-tx to sign transactions but when trying to send them to the node I got an "invalid sender" error. Besides, exactly the same ...
Juan Ignacio Pérez Sacristán's user avatar
1 vote
1 answer
106 views

"Reverse ENS lookup" using php-keccak

I am using kornrunner/php-keccak and I am attempting to do a "reverse lookup" on an ENS name, essentially the same as this question which was never answered. Any thoughts? Here's my attempt ...
cryptonub's user avatar
1 vote
1 answer
740 views

Recover public key from signature and address only works with MetaMask provider

I have to implement a login system with a web3modal using WalletConnect & MetaMask. After many attempts, it seems that all the existing source codes about this on the internet only work with ...
Gniax's user avatar
  • 21
1 vote
1 answer
937 views

How to decode log data from bscscan API using PHP?

I'm pulling fight logs from a BSC contract via bscscan API. The data record, which should be a set 6 different values, looks like this: ...
atwellpub's user avatar
  • 121
1 vote
1 answer
248 views

What are the minimum requirements for Geth server only for API calls?

I want to run a platform based on Ethereum and PHP to let our customers to sell/buy Ethereum based currencies online, and we have not any plan to mine the blockchain. In this regard, please help me to ...
Mohammad Saberi's user avatar
1 vote
2 answers
254 views

Testrpc on ubuntu

I have a .php website on my ubuntu virtual machine. I want to start the testrpc in this machine, so I can interract with my smartcontract with this web interface. Is this possible?
artem's user avatar
  • 13
1 vote
1 answer
271 views

My web3.php installation question

How can I install web3.php? Can I use shared hosting to run it or I must use vps, if I use vps I must use root to install web3.php? Thanks.
Louis's user avatar
  • 1,155
1 vote
1 answer
452 views

Dapp fundamental q about listening solidity events

Sol: I created contract with events that are raised when is called some function. Html fo: Those functions are called via web3.js with abi and address - easy. Backend (no js) asp or php: I am not ...
Qets's user avatar
  • 13
1 vote
1 answer
2k views

Generate Ethereum address in PHP?

I am working on a web application where I need to generate Ethereum addresses in PHP, how do i go about generating a random Ethereum public/private key pair in PHP? thanks.
jasmin bean's user avatar
1 vote
0 answers
118 views

how to to create and broadcast a custom token transaction in bsc with php?

i have custom token on bsc. i use some kornrunner class for signing my transaction and broadcast it but i have some problem here. when i send hex to bsc chain, return txid for me but blockHash & ...
purephp's user avatar
  • 11
1 vote
0 answers
616 views

How to call a Smart Contract function using php

I am trying to call a simple function (no parameters) from a Smart Contract currently on the Rinkeby network using php. I have an ubuntu 22.04 server with Apache, I installed composer and the ethereum-...
Joe Brown's user avatar
1 vote
0 answers
552 views

How to get the latest block of a contract with web3.php?

I need to get the latest block because 'latest' as toBlock doesn't work. I tried the code below with $toBlock = 'latest' $this->eth->getLogs([ 'fromBlock' => (is_int($fromBlock)) ? '0x' . ...
Vincent's user avatar
  • 123
1 vote
1 answer
496 views

Initiate transaction from server to smart contract

In my case, i have an API written in PHP which periodically checks the database. If certain condition was met, i need to send an alert message from the API to an account/node in the Ethereum ...
Sienz Pz's user avatar
1 vote
0 answers
1k views

Unable to locate package php5.6-mbstring [closed]

root@iZwz98r5jfsgx41dfymo6iZ:/usr/local/lib# sudo apt-get install php5.6-mbstring Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package ...
user10206110's user avatar
1 vote
1 answer
804 views

generating raw trx and sending it to the network shows "invalid sender" error

I'm trying to make an ethereum raw transaction by php and these libraries: https://github.com/simplito/elliptic-php https://github.com/kornrunner/php-keccak https://github.com/web3p/rlp this is my ...
saeid ezzati's user avatar
1 vote
0 answers
193 views

Any easy php script to sign and send transactions maybe run contract also

Thanks I have JavaScript version but not php version especially for sign and send transaction
Louis's user avatar
  • 1,155
1 vote
0 answers
544 views

Can't connect to RPC on php server

I am using php to connect RPC server. In localhost, everything works fine. I moved my files to host to test and I realised that $geth->Method_Name() is not working. If I print_r($geth), here is the ...
Ozer's user avatar
  • 11
1 vote
0 answers
67 views

I want to create a local exchange site how to add ethereum? [closed]

like a said I want to build an exchange site how can I add ethereum on it?
user21168's user avatar
1 vote
0 answers
694 views

Calling an Ethereum contract function from PHP [duplicate]

How can I call a contract function from PHP and print the return? Is there any good PHP libraries for that? thanks.
Daniel Valland's user avatar
0 votes
2 answers
888 views

PHP and wordpress

i am WordPress and php developer. i am working on the plugin development for ethereum. i does't find the sdk or api for the php or JavaScript. can you please guide me for the API documentation for the ...
user16572's user avatar