IIS 10.0 SSI error: #EXEC calls have been disabled for this virtual path

252 Views Asked by At

My IIS skills leave a lot to be desired but I've been asked to enable the SSI #exec directive for someone and I'm running into a problem: I can get SSI #echo to work, and I have this in both the applicationHost.config and the web.config in the web root:

<serverSideInclude ssiExecDisabled="false" />

But with this in my index.shtml file:

<!--#echo var="LOCAL_ADDR"--><br>
<!--#exec cmd="echo hello">-->

I get the output:

127.0.0.1
#EXEC calls have been disabled for this virtual path

I haven't explicitly set up any virtual paths and my index.shtml file is in the web root. I've searched using four search engines for that error message and can't find it mentioned anywhere.

If anyone can tell me how to get the #exec command to work, I'll really appreciate it!

The server is Microsoft-IIS/10.0 on Windows 10 Enterprise.

Thank you kindly, Andrew

1

There are 1 best solutions below

1
Jalpa Panchal On

try to set add the DWORD registry value SSIEnableCmdDirective to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters key, and set it to 1.

assign iis_iusrs and iusr permission to the cmd.exe file. or run the app pool under the custom user account which has full access permission to the access cmd.exe file.

https://learn.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525620(v%3Dvs.90)