- 1 year ago
wamp can't find cgi scripts in .py extension
Comment
1 / 1
To use CGI scripts with .py extension in WAMP, you need to configure Apache to recognize Python scripts as executable files. Here's how you can do it:
- Open the Apache configuration file httpd.conf. You can find it in the WAMP installation folder (e.g. C:\wamp64\bin\apache\apache2.4.41\conf\httpd.conf).
- Search for the following lines:vbnet
AddHandler cgi-script .cgi
ScriptInterpreterSource Registry-Strict
- Add the following line below the lines above to enable execution of Python scripts:vbnet
AddHandler cgi-script .cgi .py
- Save the file and restart Apache.
Now Apache should recognize Python scripts with .py extension as CGI scripts and execute them accordingly. Make sure the script file has the correct file permissions to be executed by the web server.