Shared hosting is an easy way to deploy PHP code especially if you are new to technology. To run PHP on your own server you need to be able to build, configure and maintain a server. You may make a mistake with a firewall configuration, and your code will not run. Paying $5 a month for a shared hosting plan allows you to focus on learning PHP.
To learn PHP you’ll need a LAMP server of some sort, a text editor, and a good study guide. I highly recommend buying a book because it’s an excellent UI while learning a language.
You can use basic ASCII Text editors to write PHP code. You simply need to save the file with the .php extension.