[mod_python] mod_python not working on Mac OS X 10.3

Carl-Johan Kihlbom div at newcode.se
Mon Dec 29 17:55:44 EST 2003


That got me a bit further, thanks, but I still can't get it to work.  
I've followed the testing procedures in the manual by setting  
AllowOverride All in httpd.conf and creating a .htaccess file in  
htdocs/test with the following content:

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

I then created a file mptest.py in the same directory. It looks like  
this:

from mod_python import apache

def handler(req):
     req.write("Hello World!")
     return apache.OK

When I try to access http://localhost/test/mptest.py I get a 500  
Internal Server Error. No additional information in the access or error  
log.

Any ideas what's wrong this time? :-)

Thanks again,

Carl-Johan Kihlbom

On Dec 28, 2003, at 22:07, Mark McClain wrote:

> Here is what I use to build on 10.3.2:
>
> 1) Build and install apache2
>
> 2) Unpack the mod_python distribution
>
> 3) make the following changes to the configure script. here it is in  
> modified form...
>
> if test "$PyFRAMEWORKDIR" != "no-framework"; then
>   if test -n "$PyFRAMEWORK"; then
>     PyPYTHONLIBS="-framework $PyFRAMEWORK"
>
>    # explicitly pass to mac linker so add this line
>     LDFLAGS="${LDFLAGS} -Wl,-framework,Python"
>   fi
>
> 4) run configure, make, then install
>
> Good luck,
> mark
>
> On Dec 28, 2003, at 12:52 PM, Carl-Johan Kihlbom wrote:
>
>> Hi list,
>>
>> I've installed mod_python on my Mac, but can't get it working. When I  
>> restart Apache after configuring httpd.conf I get the following  
>> error:
>>
>> Syntax error on line 276 of /Library/Apache2/conf/httpd.conf:
>> Cannot load /Library/Apache2/modules/mod_python.so into server: dyld:  
>> /Library/Apache2/bin/httpd Undefined symbols:
>> _PyExc_AttributeError
>> _PyExc_IOError
>> _PyExc_IndexError
>> _PyExc_KeyError
>> _PyExc_RuntimeError
>> _PyExc_StopIteration
>> _PyExc_TypeError
>> _PyExc_ValueError
>> _PyInt_Type
>> _PyList_Type
>> _PyObject_GenericGetAttr
>> _PyObject_GenericSetAttr
>> _PyString_Type
>> _PyType_Type
>> _Py_OptimizeFlag
>> __Py_NoneStruct
>> __Py_NotImplementedStruct
>>
>> I'm using mod_python 3.1.2b on my laptop running Apache 2.0.48 and  
>> Mac OS X 10.3.2.
>>
>> In Mac OS X 10.3, Python 2.3 is installed by default, and the library  
>> and include files are in  
>> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
>> python2.3/ and  
>> /System/Library/Frameworks/Python.framework/Versions/2.3/include/ 
>> python2.3/ respectively. I created symlinks to these at  
>> /usr/lib/python and /usr/include/python.
>>
>> Any ideas what I did wrong?
>>
>> TIA,
>>
>> Carl-Johan Kihlbom



More information about the Mod_python mailing list