Vous êtes sur la page 1sur 3

https://docs.microsoft.

com/en-us/iis/application-frameworks/install-and-configure-php-on-iis/install-and-configure-
php

https://docs.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-applications-on-iis/using-
fastcgi-to-host-php-applications-on-iis

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-
2012/hh994592(v=ws.11)

- Baixar zip da versão do php x86 ou x64 NTF - Non Thread Safe - http://www.php.net/downloads.php.

- Descompactar em uma pasta. Ex.: c:\php.

- Habilitar CGI/FAST-CGI no Windows server através do gerenciador de servidor > painel > adicionar funções e
recursos...
Windows Server 2012 or Windows Server 2012 R2

1. On the taskbar, click Server Manager.


2. In Server Manager, click the Manage menu, and then click Add Roles and Features.
3. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server
and click Next.
4. On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Application Development, and then
select CGI. Click Next.

.
5. On the Select Features page, click Next.
6. On the Confirm installation selections page, click Install.
7. On the Results page, click Close.

- Adicionar caminho da pasta de cada versão do php instalado no servidor à variável path em variáveis de ambiente >
variáveis do sistema.

- Configurar IIS para gerenciar as requisições PHP, pelo IIS Manager > Handler Mappings > Add Module Mapping

 Request path: *.php


 Module: FastCgiModule
 Executable: "C:[Path to your PHP installation]\php-cgi.exe" (colocar entre “”)
 Name: PHP via FastCGI
- Criar arquivo de teste na pasta c:\inetub\wwwroot.

- Requisitar url no navegador localhost\phpinfo.php para testar a instalação do php.

- Configurar IIS para executar por padrão o arquivo index.php no IIS server manager selecionando o site e
documento padrão.

https://docs.microsoft.com/en-us/iis/configuration/system.webserver/defaultdocument/

1. In the Home pane, double-click Default Document.

2. In the Actions pane, click Add...


3. In the Add Default Document dialog box, type the name of the default document that you want to add in the Name box,
and then click OK.

4. If necessary, in the Actions pane, select a default document in the list, and then click Move Up or Move Down to define the
order in which IIS should search through the default document list.
5. In the Default Document alert box, click Yes to decline configuration inheritance from a parent configuration level, or
click Noor Cancel to cancel the change in default document order.

6. If necessary, click Remove in the Actions pane to remove any file names that you do not want to use as default documents.

Instalar módulo URL Rewrite

Baixar módulo e instalar no servidor.

https://www.iis.net/downloads/microsoft/url-rewrite

Instalar site

Adicionar site apontando em qual pasta estão os arquivos.

Escrever o nome do domínio ou subdomínio no campo Hostname.

Instalar certificado letsencrypt

https://github.com/PKISharp/win-acme/releases

1. Baixar certificado no servidor IIS.


2. Descompactar certificado em uma pasta.
3. Acessar pasta pelo CMD.
4. Digitar letsencrypt.
5. N: Create new certificate
6. 1: Single binding of an IIS site
7. Escolher o site para o qual será criado o certificado.
8. Digitar e-mail para receber notificações sobre a instalação do certificado.
9. Aceitar termos do certificado.
10. Automaticamente será adicionada uma entrada https nas associações do site escolhido.

Demais configurações

- Criar cópia do arquivo php.ini-development e editá-lo para configurar o php.

- Criar regras para reescrita de url no IIS.

- Para exibir erros configure no php.ini display_errors = on para desenvolvimento, mas pode ser melhor desabilitar
para produção devido às mensagens de erro que pode parar o sistema.

- Modificações no arquivo php.ini precisam reiniciar o IIS.

To restart PHP on IIS, you actually need to restart IIS:


Click Start, click Run, type IISReset, and then click OK.

- Se alguma das extensões do PHP não estiver funcionando, verifique o caminho da propriedade extension_dir no
arquivo php.ini. A propriedade pode ter sido alterada pelo WPI.

Vous aimerez peut-être aussi