Page 65 - Open Soource Technologies 304.indd
P. 65
Open Source Technologies
Notes 5.2.3 Installing with PHP Windows Installer
When you have PHP installed, you need to make sure that your include_path PHP setting is
sensible. Some versions of the Windows PHP Installer use c:\php4\pear in the default include
path, but this directory (c:\php4) is different from the one created by the PHP Windows Installer.
So, edit your php.ini file (in c:\winnt or c:\windows, depending on your Windows version)
and change this directory to c:\php\pear (see Figure 5.2).
Figure 5.2: Example php.ini Modifications
5.2.4 Go-Pear.Org
Go-Pear.Org is a web site with a single PHP script that you can download and run to install the
latest stable version of the PEAR Installer and the PHP Foundation Classes (PFC). Go-Pear is cross-
platform and can be run from the command line and from your web server. PHP distributions
bundle a particular release of the PEAR Installer; on the other hand, go-pear gives you the newest
stable PEAR releases. However, go-pear does know your directory layout, but really contorts
itself to figure it out, and will try adapting your PEAR Installation to that. In this section, you
learn how to use go-pear from the command line and web server, and on UNIX and Windows.
5.2.5 Prerequisites
Because go-pear is written in PHP, you need a CGI or CLI version of PHP to execute it outside
the web server. By default, the CLI version is installed along with your web server PHP module.
Try running php –v to see if it is available to you:
PHP 5.0.0 (cli), Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0, Copyright (c) 1998-2004 Zend Technologies
By default, the php command is installed in the /usr/local/bin directory on UNIX, or c:\php
on Windows. In Windows, the CLI version of PHP may also be called php-cli ; in that case, you
need to type php-cli for every example that says just php.
60 LOVELY PROFESSIONAL UNIVERSITY