Doc #80044 [PATCH]: Script in documentation fails
| From: | agroot@eastlink.ca | Date: | Tue, 01 Sep 2020 14:48:46 +0000 |
| Subject: | Doc #80044 [PATCH]: Script in documentation fails | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17854@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80044&edit=1
ID: 80044
Patch added by: agroot@eastlink.ca
Reported by: agroot at eastlink dot ca
Summary: Script in documentation fails
Status: Open
Type: Documentation Problem
Package: Windows Installer
Operating System: Windows 7
PHP Version: 7.2.33
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: Updated-IIS-installation-instructions
Revision: 1598971726
URL: https://bugs.php.net/patch-display.php?bug=80044&patch=Updated-IIS-installation-instructions&revision=1598971726
Previous Comments:
------------------------------------------------------------------------
[2020-09-01 14:33:59] agroot at eastlink dot ca
Description:
------------
Ref: https://www.php.net/manual/en/install.windows.manual.php
Script fails as written. The cause is:
set phpdir=c:\php
set phppath=php-5.6.19-nts-Win32-VC11-x86
used as: '%phpdir%\%phppath%\php-cgi.exe' in several lines when phppath is empty, i.e. set
'phppath='.
The test script below corrects this, and has some added remarks.
Test script:
---------------
@echo off
echo ****************************************************
echo * *
echo * IIS Configurator *
echo * *
echo * Adds elements to IIS configuration enabling PHP. *
echo * *
echo ****************************************************
REM download .ZIP file of PHP build from http://windows.php.net/downloads/
REM decompress the .zip file to your chosen location, and set phppath below
REM to the location of php-cgi.exe in your decompressed download.
REM path to directory you decompressed PHP .ZIP file into (no trailing \)
set phppath=c:\php
REM Check for broken lines if you copied this into a batch file from the
REM documentation. Sections below have the number of lines annotated.
REM Clear current PHP handlers (3 lines)
%windir%\system32\inetsrv\appcmd clear config /section:system.webServer/fastCGI
REM The next line will generate "ERROR (message:Cannot find requested collection
element.)" if PHP is not installed. This can be ignored.
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers
/-[name='PHP_via_FastCGI']
REM Set up the PHP handler (3 lines)
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI
/+[fullPath='%phppath%\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers
/+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='%phppath%\php-
cgi.exe',resourceType='Unspecified']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers
/accessPolicy:Read,Script
REM Configure FastCGI Variables (3 lines)
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi
/[fullPath='%phppath%\php-cgi.exe'].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi
/+"[fullPath='%phppath%\php-cgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']"
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi
/+"[fullPath='%phppath%\php-cgi.exe'].environmentVariables.[name='PHPRC',value='%phppath%\php.ini']"
@echo on
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80044&edit=1