downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Passos da Instalação Manual> <Instalador do PHP para o Windows (PHP 5.1.0 e anterior)
Last updated: Fri, 13 Nov 2009

view this page in

Instalador para Windows (PHP 5.2 ou posterior)

O Instalador do PHP para Windows para versões recentes do PHP é feito usando a tecnologia MSI através do Wix Toolkit (» http://wix.sourceforge.net/). Ele instala e configura o PHP e todas as extensões PECL integradas, assim como configura muitos dos web servers mais populares, como IIS, Apache, e Xitami.

Primeiro, instale seu servidor HTTP (web) predileto no seu sistema e verifique que ele funciona. Então prossiga com um dos seguintes tipos de instação.

Instalação Normal

Execute o instalador MSI e siga as instruções fornecidas pelo programa. Ele primeiro perguntará qual Web Server você deseja configurar, assim como qualquer detalhe de configuração necessário.

Depois você deve selecionar quais funcionalidades e extensões você deseja instalar e habilitar. Para cada item disponível, você pode selecionar "Será instalado no disco local" no menu para determinar quais funcionalidades serão instaladas. Selcionado "Funcionalidade inteira será instalada no disco local", você poderá instalar todas as sub-funcionalidades vinculadas à funcionalidade (por exemplo, selecionar essa opção na extensão "PDO" você instalará todos os drivers PDO).

Aviso

Não é recomendado instalar todas as extensões, já que muitas dependem de extensões externas ao PHP para funcionarem corretamente. Ao invés, use o Installation Repair Mode (Modo de Reparo) que pode ser acionado através da opção Add/Remove Programs (Adicionar/Remover Programas) do painel de controle para habilitar ou desabilitar extensões após a instalação.

O instalador então instala o PHP para ser usado no Windows e o arquivo php.ini, e configura certos servidores web para usá-lo. O instalador configura, atualmente, o IIS, Apache, Xitami e Sambar; se você estiver usando um servidor web diferente, você precisa configurá-lo manualmente.

Instalação silenciosa

O instalador também suporta um modo silencioso, que é útil para administradores de sistema implantarem o PHP facilmente. Para usar o modo silencioso:

msiexec.exe /i php-VERSION-win32-install.msi /q

Você pode controlar o diretório de instalação passando ele como parâmetro de linha de comando. Por exemplo, para instalar em e:\php:

msiexec.exe /i php-VERSION-win32-install.msi /q INSTALLDIR=e:\php
Você também pode usar a mesma sintaxe para especificar o diretório de configuração do Apache (APACHEDIR), do Sambar (SAMBARDIR), e do Xitami (XITAMIDIR).

Você pode especificar quais funcionalidades instalar. Por exemplo, para instalar a extensão mysqli e o executável CGI:

msiexec.exe /i php-VERSION-win32-install.msi /q ADDLOCAL=cgi,ext_php_mysqli

A lista atual de funcionalidades para instalação é a seguinte:

MainExecutable - php.exe executable
ScriptExecutable - php-win.exe executable
ext_php_* - the various extensions ( for example: ext_php_mysql for MySQL )
apache13 - Apache 1.3 module
apache20 - Apache 2.0 module
apache22 - Apache 2,2 module
apacheCGI - Apache CGI executable
iis4ISAPI - IIS ISAPI module
iis4CGI - IIS CGI executable
NSAPI - Sun/iPlanet/Netscape server module
Xitami - Xitami CGI executable
Sambar - Sambar Server ISAPI module
CGI - php-cgi.exe executable
PEAR - PEAR installer
Manual - PHP Manual in CHM Format

Para mais informações sobre instalando usando instaladores MSI a partir da linha de comando, visite » http://msdn.microsoft.com/en-us/library/aa367988.aspx

Atualizado o PHP com o instalador

Para fazer atualização, execute o instalador ou graficamente, ou a partir da linha de comando normalmente. O instalador lerá as opções atuais instalação, remover a instalação velha e reinstalará o PHP com as mesmas opções de antes. É recomendado que você use esse método para manter o PHP atualizado ao invés substituir manualmente os arquivos no diretório de instalação.



add a note add a note User Contributed Notes
Instalador para Windows (PHP 5.2 ou posterior)
manville at doctors dot org dot uk
21-Jul-2009 11:50
I have just spent a tiresome morning trying to get PHP 5.2 / 5.3 installed onto Apache 2.2 (WinXPSP2) (Slight oddity in setup that program files on D: drive)

I have finally got it to work by using the following:

1) Getting installation script to use "Other CGI" (would be nice if it mentioned Apache - I believe it to be a fairly popular option)

2) Adding the following directives to httpd.conf (the Apache configuration file)

ScriptAlias /php/  "D:/Program Files/PHP/"

(This tells Apache to treat the PHP directory as script files/executables and alias it under /php/ for ease of use later)

AddHandler x-httpd-php .php

(This tells apache to recognise all .php files as of type x-httpd-php (equally you could call them anything you liked and after this mornings debacle I can think of one or two choice phrases)

Action x-httpd-php "php/php-cgi.exe"

(The tells Apache to use php-cgi.exe to handle files of type x-httpd-php (or .php files as we declared earlier). php-cgi.exe only exists if you have selected the "Other CGI" option at installation". A lot of stuff around on the web is pointing at php.exe which is now failing. Has this changed recently?)
robert dot johnson at icap dot com
19-May-2009 08:41
Looks like IIS ISAPI option is missing from php-5.2.9-2-win32-installer.msi
infoworld at yahoo dot com
12-Feb-2009 07:41
Using the installer, I have been getting the "cannot run script" error on Windows XP and IIS 5.1.  I used both the Zip file and installer filer to make it successful:

1. I downloaded the zip file (not the installer) into C:\php\,
2. extracted the contents to the same directory (C:\php\).
3. Downloaded and ran the installer into the C:\php\

Nagesh A
Anonymous
09-Jan-2009 01:06
I just installed PHP 5.2.8 (MSI package) on windows XP, IIS 5.1.

Selected IIS-ISAPI, always got error "The specified module could not be found." (firefox), HTTP 500 Internal Server Error (ie 7). Even though no extensions were selected.

Trick: Install PHP to C:\PHP (and not to C:\Program Files\PHP)

In your IIS web site properties, tab home directory, configuration, application mappings.
Remove the quotes before and after the executable path and the problem will be solved.
jstein at image dot dk
30-Dec-2008 08:33
I just installed PHP 5.2.8 as an ISAPI-extension for IIS 6 in Windows 2003 server.

I used the Windows installer, but had to make a few changes manually:

- Copy php.ini from the PHP folder (C:\Program Files\PHP) to the Windows folder (C:\Windows).

- Enable the ISAPI extension. (In IIS Manager under "Web Service Extensions" add a new extension with "Required files" set to C:\Program Files\PHP\php5isapi.dll).

- Add index.php to default index pages (select properties for "Web Sites", add it on the "Documents" tab).

 
show source | credits | sitemap | contact | advertising | mirror sites