Note that there are some explanatory texts on larger screens.

plurals
  1. POInstall mod_python for Apache 2.2.21, Python 2.5.4 on Mac OS X 10.6
    primarykey
    data
    text
    <p>I was able to install apache &amp; python successfully from source.</p> <p>I installed mod_python with following configure command:</p> <pre><code>./configure --prefix=/usr/local/python/lib/python2.5/site-packages/mod_python --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/python/bin/python2.5 </code></pre> <p>I copied my test file (mptest.py) to htdocs/test folder, following is my mptest:</p> <pre><code>from mod_python import apache def handler(req): req.log_error('handler') req.content_type = 'text/plain' req.send_http_header() req.write('mptest.py\n') return apache.OK </code></pre> <p>also i copied my .htaccess to htdocs/test folder, following is my .htaccess:</p> <pre><code>AddHandler mod_python .py PythonHandler mptest PythonDebug On </code></pre> <p>I am getting the error, Internet Server Error and following is my apache error log :</p> <pre><code>[Wed Nov 16 17:10:48 2011] [notice] mod_python: Creating 8 session mutexes based on 256 &gt;max processes and 0 max threads. [Wed Nov 16 17:10:48 2011] [notice] mod_python: using mutex_directory /tmp [Wed Nov 16 17:10:48 2011] [notice] Apache/2.2.21 (Unix) PHP/5.2.17 mod_python/3.3.2-dev-20080819 Python/2.5.4 configured -- resuming normal operations [Wed Nov 16 17:11:00 2011] [error] make_obcallback: could not import mod_python.apache.\n ImportError: No module named mod_python.apache [Wed Nov 16 17:11:00 2011] [error] make_obcallback: Python path being used "['/Library/Python/2.5/site-packages/setuptools-0.6c11-py2.5.egg', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode']". [Wed Nov 16 17:11:00 2011] [error] get_interpreter: no interpreter callback found. [Wed Nov 16 17:11:00 2011] [error] [client ::1] python_handler: Can't get/create interpreter., referer: http://localhost/test/ </code></pre> <p>my mod_python.so is linked to system's python which i dont want, proof is below. how can i link it to python installed by me?</p> <pre><code>Mac-Pro:~ user$ otool -L /usr/local/apache/modules/mod_python.so /usr/local/apache/modules/mod_python.so: /System/Library/Frameworks/Python.framework/Versions/2.5/Python (compatibility version 2.5.0, current version 2.5.4) </code></pre> <blockquote> <p>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 625.0.0)</p> </blockquote> <p>I just want to display mptest.py in my web browser, can any one help me ?</p> <p>I know mod_wsgi is better option than mod_python, but I need to make mod_python work. I will try mod_wsgi later.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload