As we’ve previously discussed, you need a server to host pages that utilize server–side scripting languages. You can, of course, use your hosting provider to serve your PHP files, but makes several assumptions:
You have a hosting provider;
It supports PHP (the majority do, but you need to check)
You’re okay with everyone in the world seeing your work in progress.
Particularly because of the last condition, it is very common to have a second, private, testing server as an intermediate step: something on which you can run your PHP code, testing it to see if it breaks, and only moving your PHP pages to the public server when you are confident that they are ready for prime time.
While there are many possibilities for the type and location of this server – within an organization, it is commonly a separate computer inside the corporate intranet and behind a firewall – it’s also very common, especially for freelance web developers, to have the server on your own machine.
Remember that a server is not defined by the hardware it runs on, or where it is, but by the software. In fact the most common collection of software that can be used as a server solution is free, and employed so frequently that it has gained its own acronym: LAMP, standing for:
- Linux
- Free, fully–featured, open–source operating system.
- Apache
- Free, open source server software: at any time, more than half of the world’s web sites are served using some version of Apache.
- MySQL
- Database creation and query language
- PHP
- Server–side scripting
Frequently the only item in this setup that changes is the operating system, leading to further derivative acronyms: WAMP (for Windows, Apache, MySQL, PHP) and MAMP (Mac OS X). We’re going to look at setting up personal, private servers for each operating system. The lessons that follow are not intended to set up your own hosting to make your web page visible to the outside world – a move I would strong advise against – but as a “server for one" so that you may look at and test your dynamic pages while working on them on your own machine.
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.