If you have enabled CGI/FastCGI using Windows Features Experience, and even so, if you don’t notice the CGI icon in IIS Manager, this post will help you fix the problem. You can also identify the problem when you go to the PHP manager and see a message stating that FastCGI must be enabled in order for PHP to be registered.
What is CGI/FastCGI in IIS?
Web technologies such as CGI (Common Gateway Interface) allow web servers (HTTP servers) to connect to external applications such as PHP. Thanks to CGI, web servers can generate and process dynamic content.
Why can’t I enable CGI/FastCGI in IIS under Windows 11/10?
Follow these tips to restore CGI/FastCGI in IIS under Windows. These solutions are known to work as suggested by forum users.
- Run SFC & DISMThen Reinstall
- Install with PowerShell
You will need an administrator account to complete the suggested steps.
The FastCGI feature must be enabled for PHP registration.
1]Run SFC and DISM then reinstall
One user reported that running the SFC and DISM tools might help resolve the issue. After you run these tools, you must uninstall CGI and reinstall it. This will return the CGI and FastCGI module in the IIS manager.
- Open Command Prompt or a Windows terminal with administrator rights
- Enter the following commands and run them one by one. Make sure you wait for them to complete before starting another one.
sfc /scannow DISM /Online /Cleanup-Image /RestoreHealth
- Your computer may restart after the tools complete. If this is not the case, we recommend that you manually restart your computer.
- Next go to Windows Featuresremove the CGI module and reinstall it.
- Check with IIS Manager if you can see the module.
2]Install with PowerShell
Another way to solve this problem is to install CGI and FastCGI in a clean boot state. This state ensures that any third-party applications can stall the correct installation. Run the following script in an elevated PowerShell window.
$features = @( "Web-WebServer", "Web-Static-Content", "Web-Http-Errors", "Web-Http-Redirect", "Web-Stat-Compression", "Web-Filtering", "Web-Asp-Net45", "Web-Net-Ext45", "Web-ISAPI-Ext", "Web-ISAPI-Filter", "Web-Mgmt-Console", "Web-Mgmt-Tools", "NET- Framework -45-ASPNET", "Web-Mgmt-Service", "Web-Windows-Auth", "Web-CGI", "Web-Dyn-Compression", "Web-Scripting-Tools", "Web-Dyn-Compression" ) # Add Windows Features add-WindowsFeature $features -Verbose
This script will come in handy if the installation fails and DISM doesn’t help.
Conclusion
It’s annoying when you turn on the feature it shows up as enabled, but it’s not what you expected. This is one of those situations. We hope that the post was easy to understand and that you were able to solve the problem that you could not enable CGI/FastCGI in IIS under Windows 11/10.
What is the difference between CGI and FastCGI?
With FastCGI, external applications can communicate with web servers more efficiently than with the Common Gateway Interface (CGI) that IIS has supported since its inception. ISAPI extensions or CGI programs traditionally run PHP on IIS. The CGI program outputs dynamic information when the web server starts it. Each CGI request is executed in a separate process that starts at the beginning and ends at the end.
In this article, we covered that the FastCGI feature must be enabled in order to register PHP. If you have any questions please don’t hesitate to ask useguide.net in the comments section below.
Source link
windows789.com