Perhaps the easiest and definitely the cheapest way to get a Web server is to run one on your existing computer. The computer you use to write your PHP code.
XAMPP is a collection of server software which will run on almost any Microsoft Windows, Linux or Mac OS X computer. Get it from this site (the latest in the 5 series is best until PHP 7 becomes widely accepted). It installs in the same way as any application except that you should install it outside of any protected areas as it explains during installation. Technically you only need the Lite version for PHP but you can install the whole thing if you want.
The name comes from the parts of the software:
- X meaning it can run on a number of operating systems
- A for Apache which is the Web server package
- M for MariaDB which is the database server you will use later (depending on the version of XAMPP it might be MySQL instead but it makes little difference)
- P for the PHP server package
- the second P for Perl which is not covered in these tutorials but is another server-side scripting language
The full version also has some other stuff but you will not need that for these tutorials.
XAMPP is not designed to be secure. If you are on a network then anyone who knows your IP address can see your pages. A firewall can block that access but otherwise you are wide open. Only leave XAMPP running if your firewall (or at least your Internet router) are protecting it. They cannot do any damage apart from to your PHP pages but that could still be a problem once you start to create proper Web sites.