downloads | documentation | faq | getting help | mailing lists | reporting bugs | sites | links | my 
search for in the  
<What's next?Unix/HP-UX installs>
view the version of this page
Last updated: Thu, 21 Aug 2003

Chapter 3. Installation

General Installation Considerations

Before installing first, you need to know what do you want to use PHP for. There are three main fields you can use PHP, as described in the What can PHP do? section:

  • Server-side scripting

  • Command line scripting

  • Client-side GUI applications

For the first and most common form, you need three things: PHP itself, a web server and a web browser. You probably already have a web browser, and depending on your operating system setup, you may also have a web server (eg. Apache on Linux or IIS on Windows). You may also rent webspace at a company. This way, you don't need to set up anything on your own, only write your PHP scripts, upload it to the server you rent, and see the results in your browser.

While setting up the server and PHP on your own, you have two choices for the method of connecting PHP to the server. For many servers PHP has a direct module interface (also called SAPI). These servers include Apache, Microsoft Internet Information Server, Netscape and iPlanet servers. Many other servers have support for ISAPI, the Microsoft module interface (OmniHTTPd for example). If PHP has no module support for your web server, you can always use it as a CGI processor. This means you set up your server to use the command line executable of PHP (php.exe on Windows) to process all PHP file requests on the server.

If you are also interested to use PHP for command line scripting (eg. write scripts autogenerating some images for you offline, or processing text files depending on some arguments you pass to them), you always need the command line executable. For more information, read the section about writing command line PHP applications. In this case, you need no server and no browser.

With PHP you can also write client side GUI applications using the PHP-GTK extension. This is a completely different approach than writing web pages, as you do not output any HTML, but manage windows and objects within them. For more information about PHP-GTK, please visit the site dedicated to this extension. PHP-GTK is not included in the official PHP distribution.

From now on, this section deals with setting up PHP for web servers on Unix and Windows with server module interfaces and CGI executables.

Downloading PHP, the source code, and binary distributions for Windows can be found at /. We recommend you to choose a mirror nearest to you for downloading the distributions.

add a note add a note User Contributed Notes
emils at tvnet dot lv
23-Aug-2003 10:23
Please note that PHP _does not_ actually work with Roxen using SAPI - most of more-complex PHP scripts/applications will cause Roxen to crash (not the least due to PHP's exit() func causing Roxen to die). Solution is to use PHP in CGI-mode with Roxen as described in the notes above.
29-Jul-2003 02:52
the link for the .ocx that you need if you get the message missing ocx control when using the windows installer in W2K with IIS listed below is broken try:
damen at nospam dot scintilla dot utwente dot nl
03-Oct-2002 10:12
How to use PHP with Roxen Webserver on a windows 2000 platform

I just set up my Roxen webserver on my windows machine and here is how I did it:

First, get the zip file with windows binaries

Copy php.ini-recommended to \WINNT\php.ini and edit it

Copy the extentions and dlls to your \WINNT\system32 folder

On your Roxen webserver, add the module cgi scripting support and give the path to your cgi-bin directory where the php.exe is placed

Add another module, redirect module, to your webserver and add the following line:

/(.*)\.php(.*)$   /cgi-bin/php.exe/$1.php$2

This should do the trick

Good Luck, Martijn
someone at somewhere dot com
29-Aug-2002 08:02
Installing PHP 4.2.2 on Microsoft Windows .NET Server ...

* Download

* Extract

* Copy php.ini-dist %SystemRoot%\php.ini

* Copy phpts.dll %SystemRoot%\system32\phpts.dll

* Open Control Panel and goto Administrative Tools and open Internet Information Services

* Open the local computer branch and goto Web Service Extensions

* Select Add a new Web service extension...

* For the Extension name type in PHP

* Hit the Add... button

* Hit the Browse... button to find php4isapi.dll in the sapi folder where you extracted

* Enable the checkbox for Set extension status to Allowed and hit OK

* Right click the Web Sites branch and select Properties

* Goto the Home Directory tab and hit the Configuration... button

* Hit the Add... button and then hit the Browse... button to find php4isapi.dll

* For the extension put php and hit the OK button

* Restart the World Wide Web Publishing Service

* Create a test file, and browse to it, see if everything works, test provided below...

  <?php phpinfo(); ?>

* Enjoy!
13-Apr-2002 08:34
This is how I easily set up PHP 4.1.2 with Sambar Server 5.0:

1.) I downloaded the smaller (920k?) CGI-only distribution and installed it.

2.) I then opened the Sambar System Administration page, (the default index.htm when Sambar is installed) went to System Configuration, and scrolled down to CGI Extensions.

3.) In the box, I added *.php, and updated the configuration.

4.) Then I opened c:\windows\php.ini, and turned off the cgi.force_redirect variable, since my PHP executable would not be accessable to the general public.

5.) Now all that needs to be done is add a "#!c:\PHP\php.exe" (change "c:\PHP" to whatever directory you installed the executable in) line to the beginning of each of your .php files.

The Sambar server will recognize .php files as CGI files and execute them automatically due to the actions in steps 2 and 3. This is probably not the most optimized way to run PHP, but it works fine for me.
info at ericbontenbal dot nl
19-Feb-2002 01:43
for using PHP on MacOSX, see article #106485 of the Apple knowledge base
daniels at ca dot ibm dot c0m
16-Jun-2001 08:09
An article that describes how to compile and use PHP with IBM DB2 Universal Database Version 7 is available at

<What's next?Unix/HP-UX installs>
 Last updated: Thu, 21 Aug 2003
show source | credits | sitemap | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Sat 01 Nov 2003 04:13:36 EST EST