Installing and Configuring PHP on Windows
This section shows you how to install PHP on Windows. We cover the manual approach of configuring your web server to use PHP that gives you the most power and flexibility over your environment. There is also an installation wizard type of approach available from the PHP web site, but this currently does not allow you to install for the Apache web server, so we will not be covering that here.
Going Straight to the Source
The most recent version of PHP can always be found at http://www.php.net/downloads.php. While you could download the source and compile it yourself, chances are you don’t have a compiler. Fortunately, the PHP downloads page has a binary distribution for Windows.
Download the latest Windows PHP distribution and extract it into a local directory. You’ll need a program such as WinZip (http://www.winzip.com) to extract the ZIP file (honoring any folder definitions as you extract the contents). At the root level of the distribution is php.exe, which you can run from a command prompt to test and experiment with PHP. If you have PHP code in a file (e.g., test.php), you can run that code with:
C:\> php -q test.php
This is mostly beneficial to you as a testing feature, but with the assistance of the GDK library you can create fully localized (Windows desktop) systems.
Configuring PHP with a Web Server
Once you have PHP on your local computer, the next thing to do is to configure it into a web server.
The choices here are many. PHP can be ...
Get Programming PHP, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.