You can buy few books or you can learn online on few learning websites or youtube or if you need any help i can teach you as well..
PHP or wordpress runs on Apache or nginx as a webserver we can build websites on windows , linux , mac operating systems. you can install each tool separately or All of them as a bundle on any operating systems and these are available as XAMP, WNMP, WAMP etc. you can work on local and start building your websites. once you are happy and ready to go live you can go for a hosting and deploy it on the server.