Python setup not working on Windows XP

G

Gowri

Hello,

I am new to Python and am trying to setup Apache to serve Python using
mod_python. I'm using a Windows XP box. here is a list of steps i
followed for the installation:

1. Installed Apache 2.2.6
2. Installed Python 2.5.1
3. Installed mod_python 3.3.1

I then included the line
LoadModule python_module modules/mod_python.so in httpd.conf

I had this one line python file (print "Hello") in htdocs of Apache. i
then started Apache and it merely echoed my code print and all.

i did some reading and thought something might be wrong with my
sys.path. This is what it reads:
'C:\\WINDOWS\\system32\\python25.zip', 'C:\\Python25\\DLLs', 'C:\
\Python25\\Lib', 'C:\\Python25\\Lib\\plat-win', 'C:\\Python25\\Lib\
\lib-tk', 'C:\\Python25', 'C:\\Python25\\Lib\\site-packages'

Somebody had said this problem could be because of the .zip file at
the beginning of the path but I haven't been able to get rid of it or
solve my problem in any other way. My Apache error file has the
entries:

[Mon Jan 07 04:11:11 2008] [error] python_init: Python executable
found 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\bin\
\httpd.exe'.
[Mon Jan 07 04:11:11 2008] [error] python_init: Python path being used
'C:\\WINDOWS\\system32\\python25.zip;C:\\Python25\\Lib;C:\\Python25\
\DLLs;C:\\Python25\\Lib\\lib-tk;;C:\\Program Files\\Apache Software
Foundation\\Apache2.2\\bin'.
[Mon Jan 07 04:11:11 2008] [notice] mod_python: Creating 8 session
mutexes based on 0 max processes and 250 max threads.


Could someone please tell me what I'm doing wrong?
 
T

Tim Roberts

Gowri said:
I am new to Python and am trying to setup Apache to serve Python using
mod_python. I'm using a Windows XP box. here is a list of steps i
followed for the installation:

1. Installed Apache 2.2.6
2. Installed Python 2.5.1
3. Installed mod_python 3.3.1

I then included the line
LoadModule python_module modules/mod_python.so in httpd.conf

I had this one line python file (print "Hello") in htdocs of Apache.

Did you put it in a file called "hello.py"? Did you create an AddHandler
for .py files? Did you create a PythonHandler referring to hello.py?
 
G

Graham Dumpleton

Did you put it in a file called "hello.py"?  Did you create an AddHandler
for .py files?  Did you create a PythonHandler referring to hello.py?

And did you (OP) read the mod_python documentation enough to know that
'print "Hello" is in no way going to work with mod_python. You cannot
just throw an arbitrary bit of Python code in a file using 'print'
statements and it will somehow magically work. You need to write your
code to the mod_python APIs.

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top