Oracle Tips by Burleson
Installing PEAR on Windows
As is the case with Linux, PEAR is delivered with
PHP. A subdirectory named PEAR and a script called go-pear.bat is
found in the D:\PHP directory. Execute this script from a DOS window,
and note the following results:
Welcome to go-pear!
Go-pear will install the 'pear' command and all
the files needed by it. This command is your tool for PEAR
installation and maintenance.
Go-pear also lets you download and install the
PEAR packages bundled with PHP: DB, Net_Socket, Net_SMTP, Mail,
If you wish to abort, press Control-C now, or
press Enter to continue:
After several more “press enter”, a warning
appears that we did not take a look at the include directory path:
WARNING! The include_path defined in the currently used php.ini does
not contain the PEAR PHP directory you just specified:
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages
include path : .;C:\php5\pear
Configured directory :
Currently used php.ini (guess) :
Press Enter to continue:
When the enter
button is pressed, another warning comes up:
** The 'pear'
command is not currently in your PATH, so you need to
** use 'D:\PHP\pear.bat' until you have added
** 'D:\PHP' to your PATH environment variable.
without parameters to see the available actions, try 'pear list' to
see what packages are installed, or 'pear help' for help.
information about PEAR, see:
* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under
This file creates ENV variables for the current user.
this file to add it to the current user registry.
Press any key
to continue . . .
Pressing enter finishes the installation script. However, there
are several more tasks to do:
Edit PHP.ini and put
and D:\PHP\PEAR in the include path.
Load D:\PHP\PEAR_ENV.reg into the registry.
into the PATH.
The first step is the easiest one to perform and
is completely analogous to Linux. By using a favorite text editor, the
following line is put into PHP.ini:
This, of course means that the Apache2 web server
will once again need to be restarted. Next, start windows explorer,
locate the file D:\PHP\PEAR_ENV.reg and double-click it. This will
load it into the registry. For changing the path, invoke regedit and
go to HKEY_CURRENT_USER->Environment. Once there, add
to the PATH variable, like shown in the following picture:
If the variable PATH does not exist, it can be
created. Now, restart Apache2 and the system, so that the installed
registry variables take effect. Next time the user logs in, they can
start the DOS window, type “pear” and view the well known menu,
exactly the same as for Linux. Using the PEAR installer on Windows is
completely identical to using it on Linux. Here is the output from the
Will upgrade archive_tar
Will upgrade pear
Will upgrade xml_rpc
downloading Archive_Tar-1.3.0.tgz ...
Starting to download Archive_Tar-1.3.0.tgz (15,200 bytes)
.....done: 15,200 bytes
downloading PEAR-1.3.5.tgz ...
Starting to download PEAR-1.3.5.tgz (108,423 bytes)
...done: 108,423 bytes
downloading XML_RPC-1.2.1.tgz ...
Starting to download XML_RPC-1.2.1.tgz (21,837 bytes)
...done: 21,837 bytes
upgrade-all ok: Archive_Tar 1.3.0
upgrade-all ok: XML_RPC 1.2.1
upgrade-all ok: PEAR 1.3.5
install DB HTML_Common HTML_Table HTML_Form
Package 'DB' already installed, skipping
downloading HTML_Common-1.2.1.tgz ...
Starting to download HTML_Common-1.2.1.tgz (3,637 bytes)
....done: 3,637 bytes
downloading HTML_Table-1.5.tgz ...
Starting to download HTML_Table-1.5.tgz (6,276 bytes)
...done: 6,276 bytes
downloading HTML_Form-1.1.2.tgz ...
Starting to download HTML_Form-1.1.2.tgz (13,605 bytes)
...done: 13,605 bytes
install ok: HTML_Common 1.2.1
install ok: HTML_Form 1.1.2
install ok: HTML_Table 1.5
PACKAGE VERSION STATE
Archive_Tar 1.3.0 stable
Console_Getopt 1.2 stable
DB 1.7.3 stable
HTML_Common 1.2.1 stable
HTML_Form 1.1.2 stable
HTML_Table 1.5 stable
Mail 1.1.4 stable
Net_SMTP 1.2.6 stable
Net_Socket 1.0.6 stable
PEAR 1.3.5 stable
PHPUnit 1.2.2 stable
XML_Parser 1.2.5 stable
XML_RPC 1.2.1 stable
The only difference from Linux is that the PEAR DB module comes
standard on Windows, yet it does not come standard on Linux.
code depot for complete scripts
The above book excerpt is from:
Create Dynamic Web Pages with Oracle Data