05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 15 CHAPTER 15<br />

<strong>PHP</strong> on Windows<br />

There are many reasons to use <strong>PHP</strong> on a Windows system, but the most common is<br />

that you want to develop web applications on your Windows desktop machine without<br />

the hassle of telnetting into the central Unix server. This is very easy to do, as<br />

<strong>PHP</strong> is extremely cross-platform friendly, and installation and configuration are<br />

becoming easier all the time.<br />

What can be confusing at first is the number of various configurations and choices<br />

available. There are many variants of the Windows operating system, and many web<br />

servers are available for those operating systems. <strong>PHP</strong> itself can run as either a<br />

dynamic link library (DLL) or a CGI script. It’s easy to get confused or to misconfigure<br />

your system. This chapter explains how to install, configure, and make the best<br />

use of <strong>PHP</strong> on Windows systems. We also show how to take advantage of the features<br />

unique to the Windows platform—connecting to databases with ODBC and<br />

controlling Microsoft Office applications through COM.<br />

Installing and Configuring <strong>PHP</strong> on Windows<br />

This section shows you how to install <strong>PHP</strong> on Windows. We cover both manually<br />

configuring your web server to use <strong>PHP</strong>, and the use of the <strong>PHP</strong> installer, which will<br />

do the configuration for you.<br />

Going Straight to the Source<br />

The most recent version of <strong>PHP</strong> can always be found at http://www.php.net/<br />

downloads.php. While you could download the source and compile it yourself,<br />

chances are you don’t have a compiler. Fortunately, the <strong>PHP</strong> downloads page has a<br />

binary distribution for Windows.<br />

Download the latest Windows <strong>PHP</strong> distribution and extract it into a local directory.<br />

You’ll need a program such as WinZip (http://www.winzip.com) to extract the<br />

ZIP file. At the root level of the distribution is php.exe, which you can run from a<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.<br />

351

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!