PHP  
downloads | documentation | faq | getting help | | php.net sites | links 
search for in the  
previousA brief history of PHPUnix/HP-UX installsnext
Last updated: Wed, 10 Jul 2002
view this page in Printer friendly version | English | Brazilian Portuguese | Czech | Dutch | Finnish | French | German | Hungarian | Japanese | Korean | Polish | Romanian | Russian | Spanish | Turkish

Capitolo 2. Installazione

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. You can find a list of hosting companies at .

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 . 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 nearest to you for downloading the distributions.

User Contributed Notes
Installazione
add a note about notes

16-Jun-2001 12:09

An article that describes how to compile and use PHP with IBM DB2 Universal
Database Version 7 is available at 


13-Feb-2002 12:29

For apache 2 (--with-apxs2) the following has to be added to the httpd.conf
as well as the AddType lines (apache_2_0_28 tested).

<FilesMatch "\.php(\..+)?$">
    SetOutputFilter PHP
</FilesMatch>


18-Feb-2002 03:43

for using PHP on MacOSX, see article #106485 of the Apple knowledge base

13-Apr-2002 12: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.


01-Jul-2002 07:45

For Apache2: Leave out the addmodule line listed in the install.txt

add a note about notes
previousA brief history of PHPUnix/HP-UX installsnext
Last updated: Wed, 10 Jul 2002
show source | credits | stats | mirror sites:  
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Fri Jul 12 08:19:06 2002 CEST