Is there a way to mine bitcoins without installing a client, that is can I do it in PHP or Node.js by adding some libraries etc which replicate what the bitcoin client would do(more or less)?
You probably want this:
It is a BTC miner that works in JS. I took it from bitcoinplus.com
I don't think that this is economically feasible though - cpu mining is a total waste - unless you're looking to do something malicious with the code like having others use your tools that also happen to utilize CPU power to mine for btc underneath - which by the way is a sure fire way to get your software banned and shunned at large. What you describe sounds like something deployed in a botnet or malware scheme - perhaps a bad android modded rom.
You will have to use some sort of program or script to do this. There are several ways, I have used
cgminerfor my mining. You can grab it from here: https://github.com/ckolivas/cgminer
3.7.2 is the last to support GPU mining if your into that sort of thing.
I have not tested these but I found this one for Node.js: https://npmjs.org/package/bitcoinjs
Hope this helps.
You can try Javaminer online. But its very slow and you're probably not going to be looking at much profit. But maybe profits aren't your main source of inspiration.... But ya you're gonna want Javaminer. If you have no client you're going to be mining with Java of some kind, I highly doubt you'd need any PHP