We help IT Professionals succeed at work.

XAMPP - cannot start Apache

cpeters5
cpeters5 used Ask the Experts™
on
I wanted to install Python addon to XAMPP.  
- Windows 7 OS
- XAMPP version 1.7.4
- Apache 2.2.17

I downloaded Python addon version 1.3 from sourceforge. but got all kinds of error. I gues I probably didn't install the Python addon correctly..

- Apache couldn't find python config. So I copy the file to Apache conf directory.  Then it couldn't find mod_python.so, so I copy the file to apache/modules directory.  It is clear that I don't know what I am doing....

Would anyone kindly point me to a very detailed instruction (dummy hand holding level) on where download mod_python, which version, how to install step by step?  

Very grateful if you can help....
pax


 
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Run httpd -t and post the output. This will test the syntax of your config files and show errors.

Author

Commented:

==================
c:\xampp\apache\bin>httpd -t
httpd: Syntax error on line 495 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 1 of C:/xampp/apache/conf/python.conf: Cannot load C:/xampp/apache/modules/mod_python.s
o into server: %1 is not a valid Win32 application.
==================

Which was what I though Apache couldn't find the mod_python.so file.

I am not sure if I treat the python addon correctly.  I have no installation instruction.  Here is what I did.

- Download Python Add on from source forge.  I didn't know where to unpacked package to.  So  I just put them on my desktop for now, hoping to find out later when I start getting error message.

- So far, I get the error that python.conf not found.  I copy it over to apache conf folder.
- restart Apache, and got the exact complaint as shown above.

Now, what's next?....


Author

Commented:

I looked into Python Addon.  Her eis what I found

The first line in pydoc is
#!/opt/lampp/bin/python

Seems like unix directory structure.  Where should I move the /opt/* filder to in Windows?

pax
Commented:
You downloaded a python module for Unix-like operating systems. You cannot use that in a Windows system.
Please find a Win32 version of the Python module at:

http://archive.apache.org/dist/httpd/modpython/win/

Are you sure about version 1.3?

Author

Commented:

The link point to the list that has mon python for at most Python v2.5.  After installing python 2.5 (I didn't uninstall python 2.7) i ran the installation script.
I got the following errors during the installation

     Could not create... mod_python 2.5
     Could not set key value ...  python 2.5 mod_python 2.3.1
     Could not set key value ...  C:\Python 2.5\Removed_Python.exe
     Could not set key value ...  C:\Python 2.5\mod_python_wininst.log

I do have full admin privilege (I think). B ut this is my company laptop which has all kinds of protection.  But I dare to continue on.

I ignored these messages and continue till completion of the installation script.
Foillow the test instruction at the given url.

Everythings seems ok, Apache restarted without any complaint.
I put a test py script at the doc root (c/xampp/appache/htdocs/test/mptest.py) as instructed.

When I point my browser to http://localhost/test/mptest.py I got the dreaded error below.  Could this be the 4 errors I got during the mod python installation? How do I fix them?

==============
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
8/5/2011 7:07:17 AM
Apache/2.2.17 (Win32) mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
=======================



 



Author

Commented:
A little more clue.  I moved mptest.py script down to the doc root level (out of the test directory). The new uri now gives some seemingly constructive error information

======================
MOD_PYTHON ERROR

ProcessId:      7120
Interpreter:    'localhost'

ServerName:     'localhost'
DocumentRoot:   'C:/xampp/htdocs'

URI:            '/mptest.py'
Location:       None
Directory:      'C:/xampp/htdocs/'
Filename:       'C:/xampp/htdocs/mptest.py'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'mptest'

Traceback (most recent call last):

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

ImportError: No module named mptest

==============================

Author

Commented:
I accept this answer since it did solve apache problem.  I will post the remaining questions in a new post since it is more related to mod_python.
Thanks Much!