views:

497

answers:

5

Can anyone help me to set up Python to run on Wampserver. From what I've read so far you would need to use a combination of Wampser, Python, mod_pyhton, and adjustment to the Apache http.conf file. I've tried it but i belive i am having conflict when it comes to versions. Does anyone know of a cobination of versions that can work so that i can do some local python development using my wampserver? Links to the download would be greatly appreciated.

My current config: Wampserver 2.0c => Apache Version : 2.2.8 , PHP Version : 5.2.6 , MySQL Version : 5.0.51b

+2  A: 

How about using web.py (download) or django?

They have their own web server, and you can also connect MySQL server with MySQLdb extension.

S.Mark
A: 

Wampserver doesn't have addon for python/django, but XAMPP does.

A good tutorial here:

http://jyotirmaya.blogspot.com/2008/11/xampp-python-django.html

Yada
A: 

Do not use mod_python; it does not do what most people think it does. Use mod_wsgi instead.

Ignacio Vazquez-Abrams
A: 

I had tried to install wamp as well as xampp and in the bargain got into some conflict. Now neither of them are able to raise Apache. so no localhost. Help!!!

satish
A: 

Recognising that the post asks about mod_python, I'm posting the following, in case using CGI is acceptable.

It has been a while since I got this to work, but I got CGI scripts written with Python to run under Wampserver with a couple simple things (although it didn't seem simple at the time):

  • Download and install Python if you haven't already. The standard install should let you run programs from a command prompt (which you'll need).
  • Write your Python CGI program, making the first line be #!python (or the full path to the python executable). While the first line isn't usually necessary for Python programs under Windows, Apache seems to need this so it knows the program is Python.
  • Place the program in your cgi-bin directory.

That should do it. I double checked my httpd.conf file and don't see any changes to get Python working. (This assumes you already have CGI working otherwise.)

The following simple script should tell you if you have things working:

#!python
print "Content-type: text/html"
print ""
print "<html>"
print "<head>"
print "<title>CGI Test of Python</title>"
print "</head>"
print "<body>"
print "This is a test"
print "</body>"
print "</html>"
GreenMatt