Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xlisModule Uses wrong configuration key/value pairs when adding handler config #305

Open
andy1547 opened this issue Apr 19, 2017 · 6 comments · May be fixed by #354 or #308
Open

xlisModule Uses wrong configuration key/value pairs when adding handler config #305

andy1547 opened this issue Apr 19, 2017 · 6 comments · May be fixed by #354 or #308
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@andy1547
Copy link

andy1547 commented Apr 19, 2017

I'm using Windows Server 2012 R2 64Bit.
I noticed that after the first successful run of the resource I was getting this error:
[[xIisModule]PHPModuleMapping] Adding fastCgi.
Filename:
Error: Cannot add duplicate collection entry of type 'application' with combined key attributes 'fullPath, arguments'
respectively set to 'C:\PHP\php-cgi.exe, '
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.AddConfigu
rationCommand
+ PSComputerName : localhost

The cause of that error is that the handler mapping gets incorrectly added as a managed handler, instead of a module mapping due to a missing Module key/value pair. Renaming the 'Module' key to 'Modules' fixed the issue.

Current Hashtable used by Add-webconfiguration /system.webServer/handlers iis:\ for adding handler:
@{ Name = $Name Path = $RequestPath Verb = $Verb -join ',' Module = $ModuleType ScriptProcessor = $Path }
Producing this xml in applicationHost.config
<add name="PHP-FastCGI" path="*.php" verb="*" scriptProcessor="C:\PHP\php-cgi.exe" />

It should be:
@{ Name = $Name Path = $RequestPath Verb = $Verb -join ',' Modules = $ModuleType ScriptProcessor = $Path ResourceType = 'File' }
Resulting in
<add name="PHP-FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="File" />

Happy to submit a PR.

@Devvox93
Copy link

Devvox93 commented Sep 6, 2017

Pull request for this is reviewed and approved.

@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Apr 23, 2018
@johlju
Copy link
Member

johlju commented Apr 23, 2018

@Devvox93 I can't you find a PR from you, either open or closed. You never sent in a PR? 🙂

@Devvox93
Copy link

@johlju I actually meant PR #308. But seeing your latest comment there I will be implementing what I suggested. So no PR yet as I've been busy with other work, but in a few days I'll be able to implement as I suggested in #308 and create a new PR with a mention of this issue. :)

@johlju
Copy link
Member

johlju commented Apr 23, 2018

@Devvox93 awesome! I will help you getting it reviewed and merged.

@scottmckenzie scottmckenzie linked a pull request May 14, 2018 that will close this issue
scottmckenzie added a commit to scottmckenzie/xWebAdministration that referenced this issue May 14, 2018
scottmckenzie added a commit to scottmckenzie/xWebAdministration that referenced this issue May 14, 2018
- Add handler to specified site (dsccommunity#305).
- Parse verbs correctly (dsccommunity#323).
@Devvox93
Copy link

Thanks for taking this up @scottmckenzie. I've been crazy busy and it totally slipped my mind :/
Apologies to @johlju also

@johlju
Copy link
Member

johlju commented May 22, 2018

Yes, @scottmckenzie is doing a great job!

No worries @Devvox93, no need to apologize. We all are very busy 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
3 participants