Configuring Python as CGI script using Xampp
December 11, 2017
It’s very easy to configure Python as a CGI script using XAMPP server. To configure Python as CGI, follow the below steps.
- Open your apache configuration file
- Search for: this line AddHandler cgi-script .cgi .pl .asp
- add .py extension at the end of this line (AddHandler cgi-script .cgi .pl .asp .py)
- Restart your apache server Step
- Create a python file
- The first line should have the path to the Python executable file
- Run the script.
Simple Python CGI script code to test:
Also, here is the short video about each and every steps to follow.