[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Python setup not working on Windows XP

jrrtolkienfan@gmail.com

1/7/2008 10:39:00 AM

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?
2 Answers

Tim Roberts

1/8/2008 6:31:00 AM

0

Gowri <gowricp@gmail.com> wrote:
>
>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?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Graham.Dumpleton

1/8/2008 11:08:00 PM

0

On Jan 8, 5:31 pm, Tim Roberts <t...@probo.com> wrote:
> Gowri <gowr...@gmail.com> wrote:
>
> >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. Installedmod_python3.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?

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