What is sys.prefix for command line Python? What WSGI directives do you have in the Apache configuration?
If there is an equivalent command to ldd on QNX, can you find out if the mod_wsgi.so is dynamically linking a Python shared library, or has a statically linked one. Sounds like it could be the latter and the mod_wsgi.so doesn't match the Python installation. Graham On 1 February 2013 03:13, Nathan Wright <[email protected]> wrote: > Yes. From root and as www. > > I expanded the hello world test app with most of the stuff on the > http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation page. > It's now... > > > import sys > import os > > def application(environ, start_response): > status = '200 OK' > > output = 'Hello World!\n\n' > output += 'sys.version = %s\n' % repr(sys.version) > output += 'sys.prefix = %s\n' % repr(sys.prefix) > output += 'sys.path = %s\n' % repr(sys.path) > output += 'mod_wsgi.process_group = %s\n' % > repr(environ['mod_wsgi.process_group']) > output += 'mod_wsgi.application_group = %s\n' % > repr(environ['mod_wsgi.application_group']) > output += 'wsgi.multithread = %s\n' % repr(environ['wsgi.multithread']) > output += 'os.environ = %s\n' % repr(os.environ) > > response_headers = [('Content-type', 'text/plain'), > ('Content-Length', str(len(output)))] > start_response(status, response_headers) > > return [output] > > ...and it's output is... > > Hello World! > > sys.version = '2.5.6 (r256:88840, Nov 26 2011, 01:20:32) \n[GCC 4.4.2]' > sys.prefix = '/usr/qnx650/host/qnx6/x86/usr' > sys.path = ['/usr/qnx650/host/qnx6/x86/usr/lib/python25.zip', > '/usr/qnx650/host/qnx6/x86/usr/lib/python2.5', > '/usr/qnx650/host/qnx6/x86/usr/lib/python2.5/plat-qnx6', > '/usr/qnx650/host/qnx6/x86/usr/lib/python2.5/lib-tk', > '/usr/qnx650/host/qnx6/x86/usr/lib/python2.5/lib-dynload', > '/usr/qnx650/host/qnx6/x86/usr/lib/python2.5/site-packages'] > mod_wsgi.process_group = '' > mod_wsgi.application_group = 'localhost.localdomain|' > wsgi.multithread = False > os.environ = {'PHOTON': '/dev/photon', 'PHFONT': '/dev/phfont', > 'LD_LIBRARY_PATH': > '/usr/pkg/lib:/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:/usr/photon/lib:/usr/photon/dll:/usr/local/lib:/opt/X11R6/lib:/usr/X11R6/lib', > 'QNX_CONFIGURATION': '/etc/qnx', 'QNX_HELP_PATH': > '/usr/qnx650/target/qnx6/usr/help/product', 'PATH': > '/sbin:/usr/sbin:/bin:/usr/bin:/usr/photon/bin:/usr/photon/appbuilder:/opt/X11R6/bin:/usr/X11R6/bin:/usr/local/bin:/opt/bin:/opt/sbin:/usr/qnx650/host/qnx6/x86/usr/bin:/usr/qnx650/host/qnx6/x86/usr/sbin:/usr/qnx650/host/qnx6/x86/sbin:/usr/qnx650/host/qnx6/x86/bin:/usr/qnx650/host/qnx6/x86/usr/photon/appbuilder:/usr/pkg/bin:/usr/pkg/sbin', > 'HOME': '/root', 'PHFIXROP': '1', 'DISPLAY': '127.1:0', 'MAKEFLAGS': > '-I/usr/qnx650/target/qnx6/usr/include', 'TERM': 'qansi-m', 'SHELL': > '/bin/sh', 'PROCESSOR': 'x86', 'PHOTON2_PATH': '/usr/photon', '_': > '/usr/pkg/sbin/httpd', 'PHTK_PATH': '/usr/photon', 'QNX_HOST': > '/usr/qnx650/host/qnx6/x86', 'QNX_HELP_HOME_PAGE': > '/usr/qnx650/target/qnx6/usr/help/product/momentics/bookset.html', > 'USER_NAME': '/dev/photon', 'SYSNAME': 'nto', 'PHINSTANCE': '1', 'PHSTART': > '1', 'TMPDIR': '/tmp', 'ABLANG': 'en_US', 'QNX_TARGET': > '/usr/qnx650/target/qnx6', 'HOSTNAME': 'localhost', 'ABLPATH': > '/usr/photon/translations', 'PHWM': 'pwm', 'PHOTON_PATH': '/usr/photon', > 'LOGNAME': 'root', 'USER': 'root'} > > > The only item striking me funny is that when running from the interpreter > sys.version is different. From the interpreter it is... > > 2.5.2 (r252:60911, Feb 24 2010, 17:29:58) [GCC 4.4.2] > > Why does Apache think it's 2.5.6? > > > On Thursday, January 31, 2013 10:44:17 AM UTC-5, Shooter wrote: > >> Can you import the time module from the Python interactive prompt? >> >> --S. >> >> On Jan 31, 2013, at 04:55, Nathan Wright wrote: >> >> > Greeting group, >> > >> > I am experiencing an odd error when Apache (as www) tries to import >> time through modwsgi. I am using the QNX 6.5 operating system. Their >> community has a pkgsrc project and I'm using their packages hosted at >> ftp://ftp.netbsd.org/pub/**pkgsrc/packages/QNX/i386/6.5.** >> 0_head_20110826/All/<ftp://ftp.netbsd.org/pub/pkgsrc/packages/QNX/i386/6.5.0_head_20110826/All/>. >> I'm running QNX in a VirtualBox VM. >> > >> > I'm running... >> > • Apache 2.2.19 (apache-2.2.19.tgz) >> > • Python 2.5 (included in QNX distribution) >> > • modwsgi 3.3 (ap22-py25-wsgi-3.3.tgz) >> > This simple test app works fine... >> > >> > import sys >> > import os >> > >> > def application(environ, start_response): >> > status = '200 OK' >> > output = 'Hello World!\n' >> > response_headers = [('Content-type', 'text/plain'), >> > ('Content-Length', str(len(output)))] >> > start_response(status, response_headers) >> > return [output] >> > >> > However this app doesn't... >> > >> > import time >> > >> > def application(environ, start_response): >> > status = '200 OK' >> > output = 'The time is %s\n' % repr(time.ctime()) >> > response_headers = [('Content-type', 'text/plain'), >> > ('Content-Length', str(len(output)))] >> > start_response(status, response_headers) >> > return [output] >> > >> > It fails on import time. At first I spent time attempting to figure >> how my permissions were wrong, and where this darn time module was. I >> discovered that it is apparently built in to the python binary (I think)? >> I am baffled why modwsgi could import sys and os but not time. >> > >> > Anyone have any suggestions on next steps? >> > >> > Much appreciated, >> > Nathan >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "modwsgi" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to modwsgi+u...@**googlegroups.com. >> > To post to this group, send email to [email protected]. >> > Visit this group at >> > http://groups.google.com/**group/modwsgi?hl=en<http://groups.google.com/group/modwsgi?hl=en>. >> >> > For more options, visit >> > https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>. >> >> > >> > >> >> -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/modwsgi?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
