Chapter 1. Installation and Basics
Hacks 1–2: Introduction
Before you start hacking PHP, you have to either install PHP or get an account on a machine that has PHP already installed. This chapter covers the basics of installing PHP, as well as installing the critical second component, the MySQL database engine, that is so commonly used to provide data that drives PHP applications. The chapter also covers installing PEAR open source modules, which you can use for free in your own PHP applications.
Install PHP
Install the PHP language on Windows, Mac OS X, and Linux, and for both Apache and Internet Information Server.
Installing PHP is the first step in using this book, and on most operating systems, it’s a very easy thing to do. PHP installation starts with going to the PHP web site (http://www.php.net/) and downloading either the source code or the binaries, along with documentation.
Installing PHP on Windows
On Windows, you need to start your PHP installation by downloading the PHP binaries for PHP Version 5. Use the .msi installer to make it easy on yourself, and specify the installation directory as c:\php5. With your PHP installation in place, you can run the PHP interpreter from a Windows DOS prompt:
C:\>php -v
PHP 5.0.4 (cli) (built: Mar 31 2005 02:45:00)
Copyright © 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend TechnologiesIf the php executable is
not found, you need to add c:\php5\bin to your path. Use the Advanced tab of the system control panel, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access