One possibility is to install the Python stuff by hand. Following is the procedure:
1. Download the latest XAMPP (version 1.6.5) from
http://www.apachefriends.de
or
http://www.apachefriends.org and install it in the C:\xampp directory
2. Download Python 2.5.1 from
http://www.python.org
and install it in the C:\Python25 directory
3. Download mod_python (version 3.3.1) from
http://www.modpython.org
and install it.
Choose the C:\Python25 directory for the Python location
and C:\xampp\apache directory as the Apache location
4. Open the file C:\xampp\apache\conf\httpd.conf
and add the line
LoadModule python_module modules/mod_python.so
at the end of the other LoadModule lines
Also add the following lines
<Directory "C:/xampp/cgi-bin">
AddHandler mod_python .py
PythonHandler python
PythonDebug On
Order allow,deny
Allow from all
</Directory>
5. Stop and restart the Apache server with the XAMPP Control Panel
If the Apache server doesn't start you made an error in the file
C:\xampp\apache\conf\httpd.conf
6. Copy the Python script TestPython.py (see bottom of this file)
into the C:\xampp\cgi-bin directory
7. Enter the adress
http://localhost/TestPython.py into your web browser
Content of the script TestPython.py:
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
import cgi,cgitb,Cookie,sys
class TestPython():
""" Tests if the XAMPP Python Add-On and mod_python are properly installed. """
def __init__(self):
""" Constructor method. """
if __debug__:
cgitb.enable() # for CGI debugging
sys.stderr = sys.stdout
def _outputHTMLGreetingPage(self):
""" Outputs an HTML response to the browser. """
print "Content-type: ", "text/html"
print ""
print "<?xml version=1.1 ?>"
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"'
print '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
print '<html xmlns="http://www.w3.org/1999/xhtml">'
print " <head>"
print " <title>My window title</title>"
print " </head>"
print " <body>"
print " <h1>Congatulation, Python works!</h1>"
print " </body>"
print "</html>"
# main program starts here
if __name__ == '__main__':
test = TestPython()
test._outputHTMLGreetingPage()