Microsoft IIS / PWS

Essa seção contêm notas e dicas específicas para o IIS (Microsoft Internet Information Server).

Aviso

Um servidor dispoto em modo CGI está aberto para várias vulnerabilidades possíveis. Por favor, leia nossa seção de segurança CGI para aprender em como se defender de tais ataques.

Considerações Gerais para qualquer instalação do PHP com IIS ou PWS

  • Primeiro, leia as Instruções de Instalação Manual. Não pule esse passo, já que ele provê informações cruciais para instalar o PHP no Windows.
  • Usuários CGI devem configurar a diretiva cgi.force_redirect para o valor 0 no arquivo php.ini.Leia o FAQ sobre cgi.force_redirect para obter detalhes importantes. Também é aconselhável configurar a diretiva cgi.redirect_status_env. Quando usar diretiva, assegure-se que as mesmas não estejam comentadas no arquivo php.ini.
  • O CGI do PHP 4 tem o nome php.exe e o do PHP 5 php-cgi.exe. No PHP 5, php.exe é o CLI, e não o CGI.
  • Modifique a variável de ambiente PATH do Windows para conter o diretório do PHP. Dessa maneira, os arquivos DLL, executáveis do PHP podem ficar no diretório do PHP sem ocupar ainda mais o diretório system do Windows. Para mais detalhes, veja o FAQ sobre Configurando o PATH.
  • O usuáiro IIS (normalmente IUSR_MACHINENAME) precisa de permissão para ler vários diretórios e arquivos, como o php.ini, docroot, e o diretório temporário de sessão.
  • Tenha certeza que as diretivas extension_dir e doc_root estão configuradas corretamente no arquivo php.ini. Essas diretivas dependem do sistema onde o PHP foi instalado. No PHP 4, extension_dir é extensions e no PHP 5 é ext. Então, um exemplo de valor extensions_dir value no PHP 5 é "c:\php\ext" e um exemplo de valor doc_root para o IIS é "c:\Inetpub\wwwroot".
  • Arquivos de DLL com extensões do PHP, tais como php_mysql.dll e php_curl.dll, são encontrados no arquivo zip do pacote do PHP (mas não no instalador do PHP). No PHP 5, muitas extensões são parte da PECL e podem ser baixadas no pacote "Coleção de módulos PECL". Arquivos como php_zip.dll e php_ssh2.dll. » Baixe arquivos do PHP aqui.
  • Quando definir o executável, a caixa 'check that file exists' também pode ser selecionada. Pou um pequeno custo de performance, o IIS (ou PWS) checará se o arquivo do script existe e decide a autenticação antes de inicializar o PHP. Isso significa que o servidor web retornará uma página 404 ao invés de erros de CGI reclamando que o PHP não teve saída de dados.
  • O executável do PHP é distribuido como um aplicação 32bit. Se você está usando uma versão 64bit do Windows, você irá também precisar recriar o binário você mesmo, ou tenha certeza que o IIS está configurado para também executar extensões 32bit. Você pode normalmente torna isto usando o IIS Administration script como segue: Cscript.exe adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

Windows NT/200x/XP e IIS 4 ou superior

O PHP pode ser instalado como binário CGI, ou como módulo ISAPI. Em ambos os casos, você precisa iniciar o Microsoft Management Console (pode aparecer como 'Internet Services Manager', ou no seu Windows NT 4.0 Option Pack ou no Control Panel=>Administrative Tools no Windows 2000/XP). Então clique no botão direito no seu ícone Web server (Provavelmente aparecerá como 'Default Web Server'), e selecione 'Properties'.

Se você quiser usar o binário CGI, faça o seguinte:

  • Em 'Home Directory', 'Virtual Directory', ou 'Directory', faça o seguinte:
  • Mude as Permissões de Execução para 'Scripts only'
  • Clique no botão 'Configuration', e escolha a aba Application Mappings. Clique em Add e configure o caminho de execução do arquivo CGI apropriado. Um valor exemplo no PHP 5: C:\php\php-cgi.exe Marque .php como a extensão. Deixe 'Method exclusions' em branco, e marque a opção 'Script engine'. Agora clique OK algumas vezes.
  • Configure a segurança apropriada. (Isso é feito no Internet Service Manager), e se seu Servidor NT usa o sistema de arquivos NTFS, adicione direito de execução para I_USR_ no diretório que contem php.exe / php-cgi.exe.

Para usuar o módulo ISAPI, faça o seguinte:

  • Se você não quiser fazer Autenticação HTTP usando o PHP, você pode (e deve) pular esse passo. Em ISAPI Filters, adicione um novo filtro ISAPI. Use PHP como nome do filtro e dê o caminho para php4isapi.dll / php5isapi.dll.
  • Em 'Home Directory', 'Virtual Directory', ou 'Directory', faça o seguinte:
  • Mude as Permissões de Execução para 'Scripts only'
  • Clique no botão 'Configuration', e escolha a aba Application Mappings. Clique em Add e configure o caminho de execução da DLL ISAPI apropriada. Um valor exemplo no PHP 5: C:\php\php5isapi.dll Marque .php como a extensão. Deixe 'Method exclusions' em branco, e marque a opção 'Script engine'. Agora clique OK algumas vezes.
  • Pare o IIS completamente (NET STOP iisadmin)
  • Inicialize o IIS novamente (NET START w3svc)

Com o IIS 6 (2003 Server), abra o IIS Manager, vá até Web Service Extensions, selecione "Add a new Web service extension", digite um nome como PHP, clique no botão Add e coloque no campo valor coloque ou o arquivo ISAPI (php4isapi.dll ou php5isapi.dll) ou do CGI (php.exe ou php-cgi.exe) e selecione a opção "Set extension status to Allowed" e clique OK.

Para usar index.php como página padrão de conteúdo, faça o seguinte: Na aba Documents, escolha Add. Digite index.php e clique OK. Ajuste a ordem clicando em Move Up ou Move Down. Isso é similar a configurar DirectoryIndex no Apache.

Os passos acima devem ser repetidos para cada extensão que será associada com scripts PHP. .php é a mais comum embora .php3 pode ser necessária para código legado.

Se ocorrer 100% de uso de CPU depois de um tempo, desligue a configuração do IIS Cache ISAPI Application.

Windows e PWS 4

PWS 4 não tem suporte a ISAPI, somente o CGI deve ser usado.

  • Edite o arquivo pws-php4cgi.reg / pws-php5cgi.reg (procure no diretório SAPI no PHP 4, ou no diretório principal do PHP 5) para refletir a localização do seu php.exe / php-cgi.exe. Barras-invertidas devem ser escapadas, por exemplo: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] ".php"="C:\\php\\php.exe" (mude para C:\\php\\php-cgi.exe se você estiver usando PHP 5) Agora adicione o arquivo ao registro do seu sistema; você pode fazer isso clicando duas vezes nele.
  • No PWS Manager, clique com o botão direito em um diretório que você queira adicionar suporte ao PHP, e selecione Properties. Marque a opção 'Execute' e confirme.

Windows e PWS/IIS 3

O método recomendado para configurar o PHP nesses servidores é usar o arquivo REG incluso na distribuição (pws-php4cgi.reg na pasta SAPI para o PHP 4, ou pws-php5cgi.reg na pasta principal para o PHP 5). Você pode querer editar o arquivo e assegurar-se que o diretório das extensões e do PHP estão corretos. Ou você pode seguir os passos abaixo para fazer manualmente.

Aviso

Esses passos involvem trabalhar diretamente com o registro do Windows. Um erro aqui pode deixar seu sistema em um estado instável. Nós recomendamos que você faça um backup do seu registro primeiro. O time de desenvolvimento do PHP não será responsável se você danificar seu registro.

  • Execute Regedit.
  • Vá até: HKEY_LOCAL_MACHINE /System /CurrentControlSet /Services /W3Svc /Parameters /ScriptMap.
  • No menu editar (edit) selecione: New->String Value.
  • Digite a extensão que você quer para seus scripts PHP. Por exemplo .php
  • Clique duas vezes no novo valor string e entre o caminho para php.exe no campo de valor. ex: C:\php\php.exe para o PHP 4, ou C:\php\php-cgi.exe para o PHP 5.
  • Repita esses passos para cada extensão que você quiser associar com scripts PHP.

Os passos a seguir não afetam a instalação do servidor web e só se aplicam se você quiser que seus scripts sejam executados quando eles forem chamados da linha de comando (ex. run C:\myscripts\test.php) ou clicando duas vezes neles na janela de visualização de diretório. Você pode pular esses passos já que você pode preferir que os arquivos PHP sejam carregados em um editor de texto quando você clicar duas vezes neles.

  • Vá até: HKEY_CLASSES_ROOT
  • No menu de editar (edit) selecione: New->Key.
  • Nomeie a chave com a extensão que você configurou na seção anterior. ex: .php
  • Selecione a chave nova e no painel do lado direto, clique duas vezes no "default value" e digite phpfile.
  • Repita o passo anterior para cada extensão que você configurou na seção anterior.
  • Agora crie um outra chave (New->Key) em HKEY_CLASSES_ROOT e chame ela de phpfile.
  • Selecione a chave nova phpfile e no painel do lado direito, clique duas vezes em "default value" e digite PHP Script.
  • Clique com o botão direito na chave phpfile e selecione New->Key, e a chame de Shell.
  • Clique com o botão direito na chave Shell e selecione New->Key, e a chame de open.
  • Clique com o botão direito na chave open e selecione New->Key, e a chame de command.
  • Selecione a chave nova command e no painel do lado direito, clique duas vezes em "default value" e entre o caminho para php.exe. ex: c:\php\php.exe -q %1. (não esqueça o %1).
  • Saia do Regedit.
  • Se estiver usando PWS no Windows, reinicie para recarrega o registro.

Usuários do PWS e do IIS 3 agora tem um sistema totalmente operacional. Usuários do IIS 3 pode usar uma » ferramenta legal de Steven Genusa para configurar os mapas dos seus scripts.

add a note add a note

User Contributed Notes 34 notes

up
2
EvilPuppetMaster
8 years ago
After having recently gone through a long process of trial and error installing both php4 and php5 on a single machine under IIS. I eventually did get it working so I thought I'd share what I learnt.

Basically, as far as I can tell there is no way to get both versions working using the ISAPI dlls unfortunately. You can however get them working using one as ISAPI and the other as CGI. And probably both as CGI too, although I didn't try that.

You'll need to know how to do a manual install of PHP anyway, see the instructions for how to do that. Make sure you follow the steps about your PATH env variable and Allowing extensions on IIS 6. Keep your php.inis in the relevant php directory and make sure they are not in your windows or system32 folders. And all that other hoopla.

The crucial part is your php.ini files. The problem being that both versions will look at your PHPRC setting and get the ini file path from that. So you'll end up with both versions running off the same INI which is no good. The way around this is to use the CGI for one version and ISAPI for the other.

The ISAPI dll never seems to look in it's own directory for the ini file, but the CGI exe does. You can use that quirk to your advantage by naming the INI file for the ISAPI version 'php-isapi.ini' and setting the PHPRC environment variable to that path. Then for the CGI version keep the php.ini in the same directory as php.exe.

Then set your virtual server to use either the ISAPI module for one version, or the CGI module for the other version, and it should work. Test using phpinfo() to ensure each version is getting it's ini file from the correct place.

Basically it seems that the ISAPI module will look in the path set in PHPRC first, and choose the php-isapi.ini file. The CGI module will look in PHPRC first too, but it upon seeing no php.ini it will then move on to search it's own directory, where it finds php.ini.
up
1
paul_noeldner at hotmail dot com
8 years ago
PROBLEM
    PHP $DOCUMENT_ROOT was not set in IIS. 
ANALYSIS
    A Google search turned up a suggestion re using ISAPI instead of CGI. 
SOLUTION
I did the fix per these suggested steps from Google search:
1 Downloaded PHP5 zip
2 Added ISAPI filter PHP5ISAPI.DLL named PHP
3 Changed document type .php to point at the PHP5ISAPI.DLL file instead of PHP.EXE.
RESULT
This worked - the php pages started picking up $DOCUMENT_ROOT as expected.
General suggestion: Don't waste time with CGI, use ISAPI.
up
1
peter at peterguy dot com
9 years ago
Installing PHP 5 on Windows Server 2003/IIS6

It has come to my attention that the link to my PHP installation guide in my posting of 07-Feb-2005 11:49 is a Bad Link.
We don't like Bad Links.

Here's the correct one:

http://www.peterguy.com/php/install_IIS6.html

Enjoy!

-Peter
up
2
Anonymous
7 years ago
This one threw me for a loop; you CAN NOT put the PHP folder in Program Files if you're installing on IIS!  I guess the space in "Program Files" throws it off, I was getting a "You must enter a valid file path" error when trying to add the PHP mapping manually.
up
2
Jamez
8 years ago
PHP 5, IIS 5, Win XP:

One thing to note: if you run phpinfo() and the 'Configuration File (php.ini) Path' points to a directory and not the actual file (ie. C:\\windows instead of C:\\windows\\php.ini) this means that it is not using your php.ini file, it is using default settings.

After spending hours searching forums the only thing that got it to work for me was to create a new environment system variable called 'PHPRC' and set it to the path where your php.ini is located (ie C:\\PHP) - simply adding C:\\PHP to the system path variable didn't do it. You have to reboot after this change of course. I'm not sure why this isn't more documented as from my searching there are quite a few people who experience this problem... hope this helps!
up
1
Person who wants ISAPI version installer
9 years ago
Hint registered to IIS 6 as ISAPI without using GUI.
(It is a machine translation from Japanese to English. )

[Method of addition to Web enhancing]

'IISEXT.VBS' is attached to IIS 6.

  <addition example>

    iisext /AddFile C:\PHP\php5isapi.dll 1 PHP 1 "PHP: Hypertext Preprocessor"

  <deletion example>

    iisext /RmFile  C:\PHP\php5isapi.dll

[Method of adding extension to Application Mappings]

To our regret, there is no good method in the standard. :-(
The source code of C# program that is registered and deleted is presented in the mapping.
(It is hoped that someone writes VBScript or the JScript version)

  <addition example>

    iis6isapimap add .PHP C:\PHP\php5isapi.dll

< deletion example>

    iis6isapimap delete .PHP

C# source code
(Add 'System.DirectoryServices' to the reference)
------------------------------------------------------------
using System;
using System.Collections;
using System.DirectoryServices;

namespace IIS6ISAPIMAP

{
    class StartClass
    {
        public static void print_man()
        {
            Console.WriteLine("IIS6ISAPIMAP [view|add|delete] <.ext> <ISAPI DLL PATH> (METHOD LIST)");
        }

        [STAThread]
        static void Main(string[] args)
        {
            if ( args.GetLength(0) < 1 )
            {
                print_man();
                return;
            }

            System.DirectoryServices.DirectoryEntry dent
                = new DirectoryEntry("IIS://localhost/W3SVC/1/root"); 
            ArrayList orglist
                = new ArrayList( dent.Properties["ScriptMaps"] )  ;

            if ( args[0].ToLower() == "view" )
            {
                foreach(string s in orglist)
                {
                    Console.WriteLine(s);
                }
            }
            else if ( args[0].ToLower() == "add" )
            {
                if ( args.GetLength(0) < 3 )
                {
                    print_man();
                }
                else
                {
                    ArrayList newlist = new ArrayList();
                    string ext = args[1];
                    string path = args[2];
                    string methods = args.GetLength(0) < 4 ? "" : args[3];
                    string newmap = ext + "," + path + ",5," + methods;

                    foreach(string s in orglist)
                    {
                        string [] tokn = s.Split(',');
                        if ( tokn[0].ToLower()  != ext.ToLower() )
                        {
                            newlist.Add( s );
                        }
                    }
                    newlist.Add( newmap );

                    dent.Properties["ScriptMaps"].Value = newlist.ToArray();
                    dent.CommitChanges();
                }
            }
            else if ( args[0].ToLower() == "delete" )
            {
                if ( args.GetLength(0) < 2 )
                {
                    print_man();
                }
                else
                {
                    ArrayList newlist = new ArrayList();
                    string ext = args[1];

                    foreach(string s in orglist)
                    {
                        string [] tokn = s.Split(',');
                        if ( tokn[0].ToLower()  != ext.ToLower() )
                        {
                            newlist.Add( s );
                        }
                    }

                    dent.Properties["ScriptMaps"].Value = newlist.ToArray();
                    dent.CommitChanges();
                }
            }
            else
            {
                print_man();
            }

            dent.Dispose();
        }
    }
}
up
1
zoe
4 years ago
ISAPI is not maintained anymore, the SAPI for IIS is now FastCGI.
up
1
Rory Clerkin
5 years ago
In the most recent release (currently 5.3.0) isapi is no longer compiled for distribution. You need to use FastCGI to get PHP to work with IIS.
FastCGI is an MS development and can be gotten at the link below;

http://www.iis.net/
up
1
carsten at enggaardblom dot dk
7 years ago
Installing PHP 5.2.1 on a Windows 2K3 Server with SP1 and IIS 6.0

- was about to give me the head ache of the year! It is NOT - repeat - NOT possible to use the CGI on a server but ISAPI works perfectly. The documentation mentions both - but cgi/fastcgi is definetely a no go.

Using the PHP installer I used the IIS option, corrected the recommended php.ini file and added the extensions I wanted.

And at this point - too - you have to restart the server to make it work, a restart of only the IIS service is not sufficient.

So mark my words, use ISAPI and don't get any errors!
up
1
paul_lynch67 at hotmail dot com
6 years ago
Hi,

I've written a manual installation guide for PHP 5.x on Windows Server 2003 and IIS 6.0 which you can find here :

http://www.iisadmin.co.uk/?p=4

This is the same article which used to be hosted on the IIS Resources web site. I hope some of you find it useful.

Regards,

Paul Lynch [IIS MVP]
up
1
Mac Rinehart
8 years ago
"Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times."

When installing PHP 5 on IIS 6.0 and Windows 2003 I encountered problems with this instruction. I  believe the root cause is that IIS requires the "scripts and executables" execute permission to be selected if the script engine has a .exe extension.

However, there may have been additional problems. Even when selecting the "scripts and executables" execute permission I continually received HTTP Header errors. The resolution was to follow the instructions for use of php5isapi.dll. The .dll extension can be run with the "scripts only" execute permission. Also remember IIS 6.0 requires that you identify Web Extensions and Allow execution of those extensions.
up
1
Marat
9 years ago
The correct required NTFS ACL's are:

- for the folder holding your PHP files:
   [Read] IUSR_servername
   [Read] IWAM_servername

-for the folder holding the PHP executables:
   [Read] IUSR_servername
up
1
Person who wants ISAPI version installer
9 years ago
Supplementation to the previous hint

The environment is Windows 2003 Server/IIS 6/PHP 5.

About IIS 6 of Windows XP.

There is no 'IISEXT.VBS'.
It seems not to have to add it to the Web enhancing
(It is not an accurate intelligence ).
Moreover, when the method argument of iis6
isapimap add is omitted, it becomes an error.
Specify it following and specifying it.

   iis6isapimap add .PHP C:\PHP\php5isapi.dll GET,POST,HEAD

Good Luck !
up
1
php at at dougdossett dot com
9 years ago
I had problems upgrading to 5.0.3 isapi on my IIS 6/Windows 2003 server.  Most of the instructions I found said to give the IUSR account access to various files/folders.  In my case I needed to give access to "Network Service" (not to be confused with just "Network"). 

1. In IIS Admin, go to Application Pools
2. Right click on the pool your site is running under and click properties. 
3. Go to the Identity tab and see what user is selected. 
4. Give that user permissions to your php files/directory.

Don't know if this will help anyone else, but thought I'd offer in case.
up
1
megawhizzz at netscape dot com
9 years ago
Path references (e.g. for browscap.ini) in php.ini MUST be enclosed with double-quotes (") instead of single-quotes(') for PHP to load correctly under IIS
up
1
venimus at mail dot com
10 years ago
Under IIS6 (and earlier)
After all the installation, do not forget to add "index.php" as default page, under the Documents tab in the Web Site's Properties.
1. Right-click Web Sites, choose Properties
2. Click Documents tab
3. Click Add...
4. Type index.php, click Ok
5. Choose "index.php" from the list and move it to the top using Move Up button.
6. Make sure "Enable default content page" is checked.

Ofcourse you can add other pages as default.

For those that do not know what is this for: If you do not provide full URL and you have several pages in the directory which are in this list, the server will return the topmost of them. In case you wish to open other page of them, you have to provide its full URL. Putting "index.php" on top will make sure no other pages will be returned as default.
up
1
jorrit at gameparty dot net
10 years ago
If you experience extreme high loading times, please have a look at this http://bugs.php.net/bug.php?id=28524
up
1
tstirrat AT optusnet DOT com DT au
10 years ago
I am running Active Directory & IIS6.0

I found that after looking through the tutorial below i was still unable to get into my site (authentication popup, 401.3 error). I set my permissions for read & execute for IUSR_(server) and IIS_WPG for both my document root and the php directory.. no luck.

However, here's how i solved the problem. (I believe this solution is relevant to fixing the active directory issue)

1. You want to give the IUSR_* and IIS_WPG read & execute permission to the PHP DIRECTORY ONLY. (I managed to remove the credentials from my document root and it still works.

2. Open IIS Manager and go to Application Pools, then to the pool which is relevant to your site (in my case DefaultAppPool).. on this item, right click and choose properties.

3. Now navigate to the identity tab.

4. My Worker process was set to Predefined: Network Service. I changed this to Configurable: IWAM_(server name) (which if you noticed is in the user group 'IIS_WPG')

Note: i also changed the passwords for my IUSR_* and IWAM_* accounts to be sure they werent set to something easy by default. Its probably a good idea to do this too.

Hope this solves someones frustration.
up
1
giunta dot gaetano at sea-aeroportimilano dot it
10 years ago
If some extensions (such as OCI or Turck mmcache in FastCGI mode) have trouble functioning with PHP+IIS, make sure that "Allow IIS to Control Password" is unchecked in the preferences panel for anonymous user access.

For more detail on the issue, read articles 216828 and 218756 in the MS Knoweledge Base.
up
1
Aaron Blew
10 years ago
Under IIS 6, don't forget that you have to add all the PHP modules you'd like to run to the PHP Web Service Extension part under the IIS management console.
up
1
nbrookins at cbwstores dot com
11 years ago
On Windows Server 2003 (formerly .net server) with IIS 6 (final RTM - build 3790)

I got PHP working by using one of the tips above (thanks!). 

I noted however, that I did not need to 'allow unknown Isapi applications' , and I was able to keep the configuration at 'Scripts Only' instead of 'Scripts and Executables'  - both settings are potentially more secure this way.

The only configuration that is different from how I normally configure PHP on IIS 5 is the addition of PHP as a Web Service Extension.
up
1
jdogg00 at msn dot com
11 years ago
Here's a quick fyi, to get PHP installed on .Net Server w/ IIS 6 you have to use the IIS manager to enable support for different web service extentions. CGI ,ASP, ISAPI are all prohibited by default. In IIS manager click on the Web Service Extentions Folder there's options to add a new extention , prohibit all extentions etc. I chose add new extention ,in the dialog box I named it PHP , click add , in the next dialog browse to path of 'php4isapi.dll' hit ok then mark checkbox "Set extention status Allowed"  hit ok and all is good. This was done after I followed the install.txt for IIS 4 or newer .
up
1
greg at wfrmls dot com
13 years ago
When using WindowsNT 4.0 and IIS, the WWW home directory needs to have Read AND Execute access rights.
up
0
user at www dot thewindowshelp dot com
4 months ago
For those of you that would like visuals, there's a video tutorial that will help you get PHP5 installed on Windows 2K3 w/ IIS6.

It's pretty straight forward.

The link to the site, if you're interested, is:
http://www.thewindowshelp.com/

The title is:
Installing PHP5 on Windows 2003 and IIS6

I hope this helps others as it did me.

Scott
up
0
bbohl2 at yahoo dot com
5 years ago
For those running IIS on Windows 2003 x64 in 32 bit mode, the registry setting for finding php.ini must start with HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\PHP.
up
0
meltir at meltir dot com
5 years ago
Note that you also have to make sure that the permissions to the php installation directory are proper -
by default they do not allow execution of php.exe and the dlls from your install dir via IIS.
(i kept getting a 401.3 ACL error)
up
0
frubi at frubi dot net
6 years ago
Under Win2003, you don't need to restart the services, if you only add PHP to a new website with its own application pool.
up
0
bbxmail1 at job1data dot com
6 years ago
i think the install steps are generally covered in the installation guideliness on this website, but this step by step guide and its explanations make the install on SBS2003 much easier to follow and implement. I spent about 3 hours searching threads and forums and not getting it all until i followed the steps at this link.
http://www.peterguy.com/php/install_IIS6.html#IISConfigure
up
0
stevegath at gmail dot com
6 years ago
After a few hours of trying everything under the sun to get PHP 5.2.3 to work on Windows Small Business Server 2003 with IIS6 with ISAPI starting from the msi install of from php.net.  I found that the install correctly used the path C:\PROGRA~1\PHP\PHP5IS~1.DLL in adding the Mapping for .php but for the Web Service Extension it used C:\Program Files\PHP\php5isapi.dll.  When I changed this to C:\PROGRA~1\PHP\PHP5IS~1.DLL.  It worked right away.  Before this change I would get a 404 error when accessing php pages.  Moral of the story is avoid spaces in all paths.
up
0
webwhammy.com
8 years ago
After installing PHP and running an http://localhost/test.php file in my browser, I encountered a COM Surrogate error. After some testing, I found that it was a result of un-checking the Cache ISAPI applications checkbox. Consequently, make sure that the Cache ISAPI applications checkbox has a check in it. To get to the checkbox go to:

Control Panel>Administrative Tools>Internet Information Services

When you are at the IIS window in the left navigational panel go to:

Local Computer>Web Sites>Default Web Site

Right-click on your default web site and select Properties. A Properties window appears. Select the Home Directory tab. Click on the Configuration... button. A Configuration window appears. Below the Mappings tab is the Cache ISAPI applications checkbox.

Again, make sure that the Cache ISAPI applications checkbox has a check in it. I hope this helps anybody else with a similar problem.
up
0
paul at heisholt dot net
9 years ago
There's a bug in IIS 5.1 which may prevent you from adding an Application Extension Mapping. If the OK button remains disabled after you've entered the Executable and the Extension, try this workaround provided by Microsoft:

1. Right-click the individual Web site or the Web Sites folder, and then click Properties.
2. On the Home Directory tab, click Configuration.
3. Under Application Configuration, click Add, and then click the Mappings tab.
4. With the Add/Edit Application Extension Mapping dialog box open, click Browse to select the .exe file or the .dll file from the local path on the Web server.

Note:
You must type the path to a valid file in the Executable text box or the OK button remains unavailable. The easiest way to make sure that you enter a valid path is to select the file by using the Browse button.

5. After the path appears in the Executable text box, click in the Executable text box to initialize the path.

6. Click in the Extension space, and then type the file name extension.

Note:
- You must enter the period (.) in front of the extension in the Extension text box, or the OK button remains unavailable.

7. When the OK button becomes active, click OK to continue.

Source: http://support.microsoft.com/?id=317948

-paul-
up
0
webmaster at avalon dot de
9 years ago
If you use IIS6 you have to add a new Webextension for PHP to work, otherwise you will get a "404"-Page if you try to point your browser to a "*.php" file.
In order to do this you have to open the IIS-management console and open the "local computer".
Under "webextensions" you will find allready a list with different extensions all being blocked by default.
To get PHP to work you have to manually add a new webextension. I only have a german version of IIS in front of me so forgive me if i translate the buttons wrongly.
Click on "New webextension". Enter any name you like for your new extension. Click on "Add..." and then on "Search...". If you would like to add the DLL just browse to your PHP-directory and you will find the php5ts.dll. If you search for the php-cgi.exe you have to change the filetype at the bottom to "CGI-Exe-Files". Only after changing the filetype you can see the php-cgi.exe file and choose it for the extension.
If you check the checkbox at the bottom of the "New extension" Window it will allow the newly added extension to be executed. Certainly you can change the status any time you want by clicking on "Allow".
Only after that procedure you will be able to get in touch with PHP-files.

sincerely
Juergen Sommer
up
0
webmaster at riachao dot com
10 years ago
In the installation with IIS 6.0, after you add the isapi extension, you need to allow the extension in the Web Services Extensions, or you 'll get a 404 error.
up
-1
shanef dot jordan at gmail dot com
6 years ago
Make sure in IIS that when you set the permissions on C:\PHP that it inherits to the folders/files within that directory.  I was doing a reinstall on a 2003/IIS 6 and whoever did the previous install took off inherit permissions.  Fought with that for several hours!!
To Top