Wiley Beginning PHP5 978-0-7645-5783-5 Manuale Utente

Codici prodotto
978-0-7645-5783-5
Pagina di 30
P1: KTX
WY027-01
WY027-Mercer WY027-v2.cls
June 5, 2004
0:44
1
Getting Up and Running
PHP, which stands for HyperText Preprocessor, is widely used for creating programmed features for
Web sites because it is easy to learn and also because PHP syntax is drawn from other widely used
languages, making it familiar to many programmers. In this chapter we present a very brief history
of PHP, and then discuss the nature of PHP as it relates to the Web.
Before you can get into the nitty-gritty of programming with PHP5, you need a clear understanding
of how PHP programs work across the Web, and that obviously implies knowledge of the Web
protocol called HyperText Transfer Protocol (HTTP). HTTP is the language or format for
communications from browser to Web server and back, and is therefore fundamental to many
aspects of PHP. HTTP gets some coverage in this chapter, and quite a bit more in Chapter 3.
You’ll see how to properly setup PHP on a Linux server, and on a Windows server as well. PHP
programs run in conjunction with Web pages, which in turn run (or are distributed by) Web server
software (such as Apache or IIS), which in turn run on top of an operating system (such as Linux or
Windows). Although it’s not strictly necessary to know everything about network operating
systems to build good PHP programs, there are many aspects of PHP that are controlled or affected
by the Web server. If you’re unfamiliar with server computers, Web servers, and the like, don’t
worry. You’ll soon see how they work, and look at the requirements and process of installing basic
Web server software.
This chapter leads you through installing PHP on a Red Hat Linux machine running Apache, and
through installing PHP on a Windows 2000 machine running IIS. Just pick the one that’s right for you.
You’ll also examine the contents of the PHP configuration file
php.ini
with you, and test your
PHP installation.
Obviously there’s a lot of work for you in this chapter, so let’s get started.
The Roots of PHP
PHP is a programming language designed to work with HTML, but unlike HTML, PHP has data
processing capabilities. If you are familiar with HTML, you know that it is not really a programming
language, but more of a rendering language—that is, HTML enables you to write Web pages using
COPYRIGHTED MATERIAL