Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XAMPP Configuration of Python
#1
I am starting to explore Python. I have downloaded the latest version of Python. Installed the same for all users and have tested it too

Output:
Python 3.11.2
Now I have also configured Python to my httpd.conf of XAMPP Apache by adding these lines.

AddHandler cgi-script .py
ScriptInterpreterSource Registry-Strict

index.py, default.py and home.py have been added as some of the default documents.

Now wrote a quick test .py script as below

print ("Hello World") and it worked fine on commandline.

Now running the same through XAMPP triggers an Internal Server Error and in the logs shows a message like

[Sun Mar 19 19:36:57.115244 2023] [win32:error] [pid 4872:tid 1896] [client ::1:57020] AH02102: C:/xampp/htdocs/index.py is not executable; ensure interpreted scripts have "#!" or "'!" first line
[Sun Mar 19 19:36:57.115244 2023] [cgi:error] [pid 4872:tid 1896] (9)Bad file descriptor: [client ::1:57020] AH01222: don't know how to spawn child process: C:/xampp/htdocs/index.py

Python is in the environmental variable and can be invoked from anywhere (for all users)
Reply
#2
You should not use XAMPP with Python.
If do web-development in Python use eg Flask,Django...ect,these comes with build in web-server for local development.
(Mar-19-2023, 02:01 PM)lavanyadeepak Wrote: AddHandler cgi-script .py
ScriptInterpreterSource Registry-Strict
Should not setup Python for cgi-script as in Python is CGI dead💀.
Python community did write a own protocol WSGI.
Today is all Python framework build on top of WSGI.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Configuration file through helm charts saisankalpj 0 1,734 Aug-23-2022, 01:32 PM
Last Post: saisankalpj
  Azure Function App Configuration Settings jdb1234 1 2,157 Oct-16-2020, 10:54 AM
Last Post: ndc85430
  Creating tables with pymysql using Xampp newbie1 0 2,135 Jul-15-2020, 11:10 AM
Last Post: newbie1
  location settings for Django Uwsgi Nginx Configuration for production sandyman 0 2,980 Sep-15-2017, 09:08 AM
Last Post: sandyman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020