Doc #80044 [Ver->Csd]: Script in documentation fails
| From: | phpdocbot@php.net | Date: | Wed, 02 Sep 2020 10:06:15 +0000 |
| Subject: | Doc #80044 [Ver->Csd]: Script in documentation fails | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17859@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
Updated by: phpdocbot@php.net
Reported by: agroot at eastlink dot ca
Summary: Script in documentation fails
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Windows Installer
Operating System: Windows 7
PHP Version: 7.2.33
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=eb5cb175e88d9b15509fc0dc241ea6135bd36ebb
Log: Fix #80044: Script in documentation fails
Previous Comments:
------------------------------------------------------------------------
[2020-09-02 10:04:34] cmb@php.net
I had a closer look, and agree that having two environment
variables here doesn't make much sense.
------------------------------------------------------------------------
[2020-09-01 15:56:12] cmb@php.net
The idea is that %phppath% is never an empty string. So you could
do:
set phpdir=c:
set phppath=php
------------------------------------------------------------------------
[2020-09-01 14:48:46] agroot at eastlink dot ca
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
------------------------------------------------------------------------
[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