Programmer's Wiki

So you want to make sites with dynamic Web pages, that is, pages that can change from one view to the next? First you need a server which is set up to accept requests. The server software can be installed on your personal computer, but this is not recommended for a deployment server because of the complexities of server administration. Alternatively, you can find a Web host; most cost, but some are free or inexpensive with a few trade-offs such as sharing a server with others and not getting an ordinary domain name (which costs money). Some of the more expensive ones offer dedicated servers, which serve only to store the files of one Web site.

Once you find a service which fits your budget, it is a good idea to set up a development server (which has zero administration overhead) on your computer. The most common arrangement is the Apache-MySQL-PHP stack, which is open-source and pre-packaged for many operating systems including all the major ones. Such packages designed for Windows are known as "WAMP" servers; see this page for a comparison of the available options. For all operating systems, see here. Alternatively, a quick search-engine query of the appropriate acronym (Linux: LAMP, Macintosh: MAMP) will give you links to a few options.

Now that you have deployment and development servers, write a PHP script in your Web directory (probably www or public_html - see your server's documentation). Test it by entering http://localhost/ followed by its filename (for example, http://localhost/test.php) in your Web browser. Once you are satsified that it works, upload it to your deployment server's Web directory and replace "localhost" in the previous URL with the domain name provided by your host. That's your page on the World Wide Web.

Version Control[]

If your deployment server is equipped with an SVN or CVS client, you can install a compatible client on your own machine and use version control to ensure that the files on the two servers are synchronised, automate the process of downloading and uploading, and keep track of all past changes in case one of them is incorrect.