[Ethereum] Interact with MetaMask via PHP

metamaskphpweb3js

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('127.0.0.1', 8545);

Javascript equivalent (JS):

web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

But the PHP one posted above can only connect to a server node via IP address and I'm not sure if its possible / how to connect with a metamask user in PHP.

I dont think its possible because PHP is server side but if anyone has some insight on this I would appreciate it..

Best Answer

No, this is not possible. PHP is executed on the server, JavaScript is executed in the browser. PHP could theoretically connect to a node that you run yourself on your own server, but not to a node on the client or to a browser add-on.

Related Topic