php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80044 Script in documentation fails
Submitted: 2020-09-01 14:33 UTC Modified: 2020-09-02 10:04 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: agroot at eastlink dot ca Assigned: cmb (profile)
Status: Closed Package: Windows Installer
PHP Version: 7.2.33 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 49 = ?
Subscribe to this entry?

 
 [2020-09-01 14:33 UTC] 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



Patches

Updated-IIS-installation-instructions (last revision 2020-09-01 14:48 UTC by agroot at eastlink dot ca)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-01 14:48 UTC] 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 15:56 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-09-01 15:56 UTC] 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-02 10:04 UTC] cmb@php.net
-Status: Assigned +Status: Verified
 [2020-09-02 10:04 UTC] cmb@php.net
I had a closer look, and agree that having two environment
variables here doesn't make much sense.
 [2020-09-02 10:06 UTC] phpdocbot@php.net
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
 [2020-09-02 10:06 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-09-02 12:45 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=52572be830de384a34de2284644885aee0007245
Log: Fix #80044: Script in documentation fails Improve Windows installation docsParticulary wrt. proper sectioning and personalization.
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=58ee6f9d61dd1bd20d0b4a3c09c08ac3ba471c28
Log: Fix #80044: Script in documentation fails Improve Windows installation docsParticulary wrt. proper sectioning and personalization.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jul 02 15:05:46 2022 UTC