Configuring Python as CGI script using Xampp

It’s very easy to configure Python as a CGI script using XAMPP server. To configure Python as CGI, follow the below steps.

  1. Open your apache configuration file
  2. Search for: this line AddHandler cgi-script .cgi .pl .asp
  3. add .py extension at the end of this line (AddHandler cgi-script .cgi .pl .asp .py)
  4. Restart your apache server Step
  5. Create a python file
  6. The first line should have the path to the Python executable file
  7. Run the script.

Simple Python CGI script code to test:

Also, here is the short video about each and every steps to follow.


You may also like


Follow me

Popular posts