Learn how this scripting language can add functionality to your site.

Page 1  2
Last week we talked about how to use Apache as a basic Web server. I mentioned that you should have PHP working. On today's show I'll show you PHP and how it works.

Let's test that you've correctly installed PHP before doing some basic PHP programming.

In the public_html directory you created last week, create a file called "test.php" and use your favorite editor to put the following information into it:

<?

print "Hello World! If you see this text, without the print or other stuff, it worked";

?>


If you saw nothing, then you aren't running PHP properly on the machine. You should make sure that you installed it when you installed Apache. If you saw the "Hello World" stuff, then we're in business.

This article won't teach you how to program, and it won't touch anything but the very basics of what PHP can do. PHP is a very flexible and powerful scripting language originally designed to fill the gap between basic Apache server scripting and full-fledged general-purpose scripting languages such as Perl and TCL. While both Perl and TCL are terrific languages, they can be a bit more than people need for simple webpages.

PHP is a great example of the open-source community seeing a need and filling it to solve its own problems.

Chris DiBona is the director of special projects for OSDN. DiBona has posted a frequently asked questions list on the Web.

Page 1  2