logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: How to use Python as web script with Apache in windows 10
Author
sunilpandya



Joined: 08 Sep 2016
Posts: 12
Location: India

PostPosted: Fri 11 Sep '20 16:51    Post subject: How to use Python as web script with Apache in windows 10 Reply with quote

I want to know what should be configuration of using python- 3.8.5 to use with apache 2.4.46.0 Request to help me. That is I want to use Python as CGI Script in place of PHP
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 13 Sep '20 19:43    Post subject: Reply with quote

Pretty simple, same as any other cgi file.

In httpd.conf add .py to the AddHandler cgi-script line.

AddHandler cgi-script .cgi .pl .py

First line of the script/s need to have a shebang informing the Apache of the location to and including python.exe on the server.

#!/location/of/python.exe
Back to top


Reply to topic   Topic: How to use Python as web script with Apache in windows 10 View previous topic :: View next topic
Post new topic   Forum Index -> Apache