The problem of PHP is that it would need to run in the user machine.
When building web apps you have 2 sides :
- The code that run on the user computer (client)
For example javascript in their browser, their IPFS node, …
- And the code that run on your own computers (servers)
For example a PHP + mysql server.
I guess you already knew that.
What web 3.0 is about, is removing the second category, you now only have the first, the code running the client (and also making this code opensource and reviewing it so users trust this code).
Actually it’s not really removing servers, you still have other computers, you just don’t trust them, whatever they do is seen as wrong unless proven otherwise.
So whatever your protocol does must be checked by the client, ideally all the way your server could cheat must be fixed in the client.
There are many ways to fix this, one example is for everyone to run everything, so if an other computer do a calculation other one need to know about (example moving money from an account to an other), instead of sending the result authoritarly, you send cryptographical proof from the sender account and everyone checks it and moves funds accordingly on their side, and everyone keep track of the current state and change it accordingly.
This is how blockchain works for example.
In reality it’s unlikely that you will start from nothing, you have a bunch of code and networks ready to use that will make your life easier. For example if you need a server and a database, instead of rewriting a blockchain yourself, you could just use ethereum.
So you could write a web 3.0 app on PHP, but that would be almost nothing like you know currently, you would need each user to run their own node, running PHP code to check that other nodes aren’t doing bad.
You could also go for a half centralised network like fediverse, have a bunch of user accessing a centralised node, however the nodes themself are running a decentralised network and you could just spin up your node to join it.
The reality is that the most decentralization is done when all users run their own node and trust no one.
And there are really good tooling to go about that.
- Have a backend written in solidity or vyper and deployed on the ethereum blockchain (so everyone can see and check what is happenning).
- And a client displaying informations in a nice way to the users, this could be anything that a user run in it’s computer but the reality of it is, JS is very likely the best for that, everyone has a browser, the simplest way to connect to web3 is through your browser, so why would you use something else ?
That why most dapps are built using:
- solidity for backend
- js with web3 + html + what other crap a browser need to make that pretty for the client
Then IPFS to distribute the js
and html
.
As this is a really strong base that will save you many months of your life building something new, and many years for people to start trusting it.