If you still receive 404 errors... try this...
I had to:
1) right click on My Computer, select Manage
2) open up "Services and Applications" -> "Internet Information Services" -> "Web Sites" -> mywebsite (where mywebsite could be "Default Web Site" or whatever my web site is named)
3) right-click on mywebsite and select Properties
choose the "Home Directory" tab, select Configuration... button
4) either select the .php extension and choose the Edit... button, or if .php isn't listed then press the Add... button
5) make the Executable C:\WINDOWS\system32\inetsrv\fcgiext.dll, the extension .php, and ensure Verbs are limited to GET,HEAD,POST, check the "Script engine" and "Verify that file exists" check boxes
Once I did this I at least now get the 500 fastcgi error
Microsoft IIS 5.1 et IIS 6.0
Cette section contient les instructions pour une installation manuelle sous IIS (Internet Information Services) 5.1 et IIS 6.0 de PHP sous Microsoft Windows XP et Windows Server 2003. Pour des instructions sur la configuration sous IIS 7.0 et supérieur sous Windows Vista, Windows Server 2008, Windows 7 et Windows Server 2008 R2, reportez-vous à la section Microsoft IIS 7.0 et suivant.
Configuration sous IIS pour traiter les requêtes PHP
Téléchargez et installez PHP suivant les instructions décrites dans les étapes d'installation manuelle.
Note:
La version PHP non thread-safe est recommandé lors de l'utilisation d'IIS. Ces versions sont disponibles sur la page » PHP pour Windows : Binaires et sources.
Configurez les options CGI- et FastCGI du fichier php.ini comme ceci :
Exemple #1 Options de configuration de CGI et FastCGI du fichier php.ini
fastcgi.impersonate = 1 fastcgi.logging = 0 cgi.fix_pathinfo=1 cgi.force_redirect = 0
Téléchargez et installez l'extension » Microsoft FastCGI pour IIS 5.1 et 6.0. L'extension est disponible pour les plate-formes 32-bit et 64-bit - sélectionnez le bon paquet pour votre plate-forme..
Configurez l'extension FastCGI pour gérer les requêtes spécifiques PHP en exécutant la commande ci-dessous. Remplacez la valeur du paramètre "-path" avec le chemin absolu vers le fichier php-cgi.exe.
Exemple #2 Configuration de l'extension FastCGI pour gérer les requêtes PHP
cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^ -extension:php -path:"C:\PHP\php-cgi.exe"
Cette commande va créer un mapping des scripts IIS pour les extensions de fichiers *.php, ce qui aura pour effet la gestion de toutes les URLs se terminant par .php par l'extension FastCGI. De plus, la commande configurera l'extension FastCGI lui demandant d'utiliser l'exécutable php-cgi.exe pour traiter les requêtes PHP.
Note:
A ce point, les étapes d'installation et de configuration nécessaires sont terminées. Les instructions qui suivent dans cette section sont optionnelles mais vivement recommandées afin d'atteindre des fonctionnalités et des performances optimales de PHP sous IIS.
Usurpation d'identité et accès au système de fichiers
Il est recommandé d'activer l'usurpation d'identité pour FastCGI en PHP lors de l'utilisation avec IIS. Ce mode est contrôlé par la directive fastcgi.impersonate du fichier php.ini. Lorsque ce mode est activé, PHP effectuera toutes les opérations du système de fichiers avec le compte utilisateur qui a été choisi pour l'authentification IIS. Ceci assure que, même si le même processus PHP est partagé avec différents sites web IIS, les scripts PHP de ces sites web ne pourront pas accéder aux autres fichiers tant que différents comptes utilisateurs sont utilisées pour l'authentification IIS de chaque site web.
Par exemple, IIS 5.1 et IIS 6.0, dans leurs configurations par défaut, ont d'activé l'authentification anonyme avec le compte interne IUSR_<MACHINE_NAME> utilisé comme identité par défaut. Ceci signifie que, afin de permettre à IIS d'exécuter des scripts PHP, il est nécessaire de donner les droits de lecture au compte IUSR_<MACHINE_NAME> pour ces scripts. Si les applications PHP doivent effectuer des opérations en écriture sur certains fichiers ou écrire des fichiers dans des dossiers, le compte IUSR_<MACHINE_NAME> doit avoir les permissions en écriture sur ces différents éléments.
Pour déterminer quel est le compte utilisateur utilisé par l'authentification anonyme IIS, suivez ces étapes :
-
Dans le menu de démarrage de Windows, choisissez : "Run:", tapez "inetmgr" et cliquez sur "Ok";
-
Dépliez la liste des sites Web sous le nœud "Web Sites" de l'arbre, faîtes un clic droit sur un site web utilisé et sélectionnez "Properties";
-
Cliquez sur l'onglet "Directory Security";
-
Prenez note du champ "User name:" dans le dialogue "Authentication Methods"
Pour modifier la configuration des permissions sur des fichiers ou des dossiers, utilisez l'explorateur Windows ou la commande icacls.
Exemple #3 Configuration des permissions d'accès
icacls C:\inetpub\wwwroot\upload /grant IUSR:(OI)(CI)(M)
Définition du fichier index.php comme document par défaut sous IIS
Les documents par défaut IIS sont utilisés pour les requêtes HTTP qui ne spécifie pas de nom de document. Avec les applications PHP, index.php agit généralement comme document par défaut. Pour ajouter index.php à la liste des documents par défaut IIS, suivez ces étapes :
-
Dans le menu de démarrage Windows, choisissez "Run:", tapez "inetmgr" et cliquez sur "Ok";
-
faîtes un clic droit sur le nœud "Web Sites" de l'arbre et sélectionnez "Properties";
-
Cliquez sur l'onglet "Documents";
-
Cliquez sur le bouton "Add..." et entrez "index.php" comme "Default content page:".
Configuration du recyclage FastCGI et PHP
Configurez l'extension IIS FastCGI pour le recyclage des processus PHP en utilisant la commande ci-dessous. La directive instanceMaxRequests de FastCGI contrôle le nombre de requêtes a traité par un seul processus php-cgi.exe avant l'extinction de l'extension FastCGI. La variable d'environnement PHP PHP_FCGI_MAX_REQUESTS contrôle le nombre de requêtes qu'un seul processus php-cgi.exe peut gérer avant de ce recycler lui-même. Assurez-vous que la valeur spécifiée pour la directive InstanceMaxRequests FastCGI est inférieure ou égale à la valeur spécifiée pour la directive PHP_FCGI_MAX_REQUESTS.
Exemple #4 Configuration du recyclage FastCGI et PHP
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^ -InstanceMaxRequests:10000 cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^ -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000
Configuration du délai d'expiration FastCGI
Augmentez le délai d'expiration pour l'extension FastCGI s'il y a des applications dont les scripts PHP mettent beaucoup de temps à s'exécuter. Les 2 configurations qui contrôlent les délais d'expiration sont ActivityTimeout et RequestTimeout. Referez-vous à la » configuration de l'extension FastCGI pour IIS 6.0 pour plus d'informations sur ces configurations.
Exemple #5 Configuration du délai d'expiration FastCGI
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^ -ActivityTimeout:90 cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^ -RequestTimeout:90
Modification du dossier contenant le fichier php.ini
PHP recherche le fichier php.ini dans différents endroits et il est possible de modifier ces endroits de recherche du fichier php.ini en utilisant la variable d'environnement PHPRC. Pour demander à PHP de charger le fichier de configuration depuis un dossier personnalisé, exécutez la commande ci-dessous. Le chemin absolu du dossier contenant le fichier php.ini doit être spécifié sous la variable d'environnement PHPRC.
Exemple #6 Modification du dossier contenant le fichier php.ini
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^ -EnvironmentVars:PHPRC:"C:\Some\Directory\"
When installing PHP 5.3 on IIS by following the manual installation steps described here (http://www.php.net/manual/en/install.windows.iis6.php) and here (http://www.php.net/manual/en/install.windows.iis7.php) it is possible to get the following error from FastCGI:
HTTP Error 500.0 - Internal Server Error
Module: FastCgiModule
Notification: ExecuteRequestHandler
Handler: php-5.3.6
Error code: 0x800736b1
The reason this error happens is because PHP 5.3 is built by using Visual C++ 2008 compiler (VC9) and hence requires Visual C++ 2008 runtime to be installed on the machine. This error does not happen when PHP 5.3 is installed by Web Platform Installer or if you already have URL Rewrite module installed.
To fix the error download and install Visual C++ 2008 runtime from here:
http://www.microsoft.com/downloads/en/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
(Make sure to use x86 version even if you have x64 environment)
i`ve the same trouble after the install php 5.2.14-nts on IIS6 (Win2003Server)- try to open-dialog when php-file is opening...
I`ve to manual add .php in "Application configuration" ... \system32\inetsrv\fcgiext.dll (even this option selected in installation - "Script executable")
this solved the problem :)
Using Win 2003 Server, IIS 6, PHP 5. If after running the command:
cscript fcgiconfig.js -add -section:"PHP" -extension:"php" -path:"C:\PHP\php-cgi.exe"
(with the right quotation as pointed in a previous note)
You get the following error/message:
C:\WINDOWS\system32\inetsrv\fcgiconfig.js(1326, 5) (null): 0xFFFFFFDF
It may be because you have a previous version of C:\WINDOWS\system32\inetsrv\fcgiext.ini. So backup the file and make a clean one with only an empty [types] section. Run the command again and it should work.
I used Windows 2003 Server, IIS 6.0, MS SQL Server 2008, and PHP 5.3 along with FastCGI. If, after following the set up step-by-steps, you continually get a FastCGI 500 timeout error check your MS SQL Server PHP driver.
MS SQL Server PHP driver 3.0 which was updated on 04/18 requires you have the 2012 MS SQL Server Native Client (v 11). But if you are using MS SQL Server 2008 like I was you only have the 2008 MS SQL Server Native Client (v 10). For whatever reason I could not get the 2012 Native CLient to install on the OS even though it appeared MS's website said it should be able to.
So just downgrade to the MS SQL Server PHP driver 2.0. The site says it will be deprecated but at least you can get up and running for a while until you have to upgrade your OS and MS SQL Server.
This kinda drove me nuts for a few hours.
Installing PHP 5.4 on Windows Server 2003 R2 Standard Edition with IIS 6:
Issue: After installing PHP I was getting 404 errors on all .php pages, even if I browsed from within IIS Manager.
Solution: Add a PHP Web Service Extension:
In IIS Manager, expande the local computer node on the left and right-click on Web Service Extensions. From the context menu select "Add a new Web service extension..."
In the New Web Service Extension dialog:
Extension name: PHP
Required files: Add... path to php.exe (eg C:\PHP\php.exe)
Set status of new web service extension to Allowed.
NOTE: Seems to work equally well if you use the path to php.exe or php-cgi.exe.
If you receive:
Input Error: There is no script engine for file extension ".js".
When executing:
cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe"
Include the switch:
/e:jscript
Like this:
cscript /e:jscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe"
Worked on freshly installed XP Pro ENG SP3(updated).
I am using Win 2003 Server SP2, IIS 6, Installing PHP 5.3.10 as FastCGI
If you continue to receive FastCGI could not proccess your request - Access Denied Error -5 check to make sure the IIS_WPG Group has Read, Read/Execute permission to the PHP installation directory and is inherited to the php-cgi.exe file.
Also, in researching this problem during my installation, I also found that you should have an entry in the IIS Web Extensions for the php-cgi.exe.
When executing:
cscript %windir%\system32\inetsrv\fcgico
nfig.js -add -section:"PHP" ^
More? -extension:php -path:"C:\PHP\php-cgi.exe"
You get this response:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
C:\WINDOWS\system32\inetsrv\fcgiconfig.js(1348, 5) (null): 0xFFFFFFDF
Then check if in the C:\WINDOWS\system32\inetsrv\fcgiext.ini file the next text is present:
[Types]
php=c:\php\php-cgi.exe
[c:\php\php-cgi.exe]
QueueLength=999
MaxInstances=20
InstanceMaxRequests=10000
IdleTimeout=90
RequestTimeout=90
If not, add it, worked for me!
A note for your reference ... I was getting error 404 "file not found when trying to browse .php" files in \inetpub\wwwroot although .html files worked fine... messed around for hours until I tried this on advice of a friend.
FYI ...
Operating system Windows Server 2003 SP2 x64
IIS v6.0
PHP v 5.3.5 nts windows x86
Microsoft C++ 2008 redistributable
no fastcgi
Followed all the manual PHP configuration instructions very carefully, set php.ini directives, gave appropriate permissions to "IUSR_(machine)", set up web extensions etc. etc.
The final fix that made everything work... renamed 'php.ini' to 'php-cgi-fcgi.ini'
Hope this saves someone hours...
I am using Win 2003 Server, IIS 6, PHP 5.
If you see "You are not authorized to view this page" error when running your PHP page.
Try one more thing:
1. Right-click {C:\php} (or your PHP installation root) and select {Properties}
2. Select {Security} tab and click {Add} button
3. Enter {ComputerName/IUSR_ComputerName} as object name and press {OK}
4. Select {Read & Execute} as permissions
5. Click {Advanced} button and select {Allow inheritable permissions from the parent...} checkbox
6. Press {OK}
Facts: WinXp Pro, IIS 5.1, add extension ".php" to default web site, Ok button disabled from application configuration mapping after setting the path to executable
Solution: Click inside the textbox after setting the path will enable ok button
Source: http://support.microsoft.com/?id=317948
Using WinXP/SP3, IIS5.1, I found that following the instructions added the .PHP file association to the 'Web Sites' level in the IIS Manager, but when I tried to access a PHP page my browser tried to download it. I had to add the same .PHP file association to the 'Default Web Site' configuration too.
Using PHP 5.3.2 non thread safe VC9 I had to copy the php.ini to php-cgi-fcgi.ini otherwise I just got 404 errors.
