Your First PHP Script

Now that you have a feel for what PHP is, it's time to dive in and start writing PHP' programs. To do this, you'll first need access to a Web server running PHP'. This chapter kicks off by showing you, in simple terms, how to install the following programs on your computer:

  • The Apache Web server
  • The PHP' engine
  • The MySQL database server

You also learn a bit about troubleshooting Web servers as you go.

  • The installation process is fairly straightforward; however f you're put off by the idea of having to install these programs on your computer, you can instead run ybur PHP scripts on a remote Web server that's already set up for the job (see the section "Running PHP' Remotely" later in the chapter).
  • Once you have PHP' up and running, you get to create your first PHP' script. Along the way, you learn how you can embed PHP code within an HTML Web page, which is one of the fundamental concepts of PHP'.
  • You then extend your script to display some dynamic information in the page-in this case, the
    current time-and you also learn about comments: how to write them, and why they're useful.