Okay, this is confusing.
This specific problem is usually caused because Oracle libraries are not in a
standard directory location. It is therefore necessary to set DYLD_LIBRARY_PATH
environment variable to say where they reside.
When I did the ‘otool -L’ test on cx_Oracle.so I asked you to ensure you had
unset the DYLD_LIBRARY_PATH environment variable. With that not set, if
DYLD_LIBRARY_PATH was required I would have expected ‘otool -L’ to not be able
to resolve the Oracle library, yet it was.
Even if you hadn’t unset it, it means it was in your environment either way.
This means that when you ran mod_wsgi-express it should have inherited
DYLD_LIBRARY_PATH and it still should find the Oracle libraries when loading
cx_Oracle.so.
Few more things to check.
Find the ‘apachectl’ script that is generated by mod_wsgi-express. Usually it
would be at:
/tmp/mod_wsgi-localhost\:8000\:502/apachectl
What does it have for:
SHLIBPATH=""
if [ "x$SHLIBPATH" != "x" ]; then
DYLD_LIBRARY_PATH="$SHLIBPATH:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH
fi
It should probably be the same, but want to check.
Also edit:
/tmp/mod_wsgi-localhost\:8000\:502/envvars
and add to it:
env
This will output to console when running mod_wsgi-express all the environment
variables set.
What does DYLD_LIBRARY_PATH show in that? Are there any other DYLD environment
variables set?
Also trying running mod_wsgi-express with this test WSGI application:
https://raw.githubusercontent.com/GrahamDumpleton/mod_wsgi/develop/tests/events.wsgi
<https://raw.githubusercontent.com/GrahamDumpleton/mod_wsgi/develop/tests/events.wsgi>
What DYLD environment variables get through to the WSGI application.
Graham
> On 24 Aug 2016, at 11:44 PM, Teemu Korpijaakko <[email protected]> wrote:
>
> I'm sorry. I forgot to run the virtualenv interpreter...
>
> ('HTTPD', '/usr/sbin/httpd')
>
> ('WITH_TARBALL_PACKAGE', False)
>
> ('ROTATELOGS', '/usr/sbin/rotatelogs')
>
> ('WITH_HTTPD_PACKAGE', False)
>
> ('__file__',
> '/Users/teemu/edge_tools/flask/lib/python2.7/site-packages/mod_wsgi/server/apxs_config.pyc')
>
> ('PROGNAME', 'httpd')
>
> ('__package__', 'mod_wsgi.server')
>
> ('SBINDIR', '/usr/sbin')
>
> ('MPM_NAME', '')
>
> ('LIBEXECDIR', '/usr/libexec/apache2')
>
> ('SHLIBPATH_VAR', 'DYLD_LIBRARY_PATH')
>
> ('__name__', 'mod_wsgi.server.apxs_config')
>
> ('SHLIBPATH', '')
>
> ('os', <module 'os' from
> '/Users/teemu/edge_tools/flask/lib/python2.7/os.pyc'>)
>
> ('__doc__', None)
>
> ('BINDIR', '/usr/bin')
>
>
>
>
> On Wednesday, August 24, 2016 at 9:39:20 AM UTC-4, Teemu Korpijaakko wrote:
> I'm getting ImportError: No module name mod_wsgi.server.apxs_config
>
> On Tuesday, August 23, 2016 at 11:36:55 PM UTC-4, Graham Dumpleton wrote:
> What do you get if you fire up the command line Python interpreter and enter:
>
> import mod_wsgi.server.apxs_config as config
> for k,v in config.__dict__.items():
> if k != '__builtins__': print(k, v))
>
> Graham
>
>> On 24 Aug 2016, at 6:50 AM, Teemu Korpijaakko <[email protected] <>> wrote:
>>
>> Thank you for the quick reply! I've run the commands you listed and the
>> output is as follows:
>>
>>
>>
>> /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so:
>> Mach-O universal binary with 2 architectures
>>
>> /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so (for
>> architecture i386): Mach-O bundle i386
>>
>> /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so (for
>> architecture x86_64): Mach-O 64-bit bundle x86_64
>>
>>
>>
>> and
>>
>>
>>
>> /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so:
>>
>> /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 (compatibility
>> version 0.0.0, current version 0.0.0)
>>
>>
>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version 1226.10.1)
>>
>>
>> On Tuesday, August 23, 2016 at 4:34:54 PM UTC-4, Graham Dumpleton wrote:
>> What do you get one when you run:
>>
>> file
>> /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so
>>
>> and:
>>
>> otool -L
>> /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so
>>
>> When doing the latter make sure that you don’t have ‘DYLD_LIBRARY_PATH’
>> environment variable set.
>>
>> On MacOS X that error generally means that the shared library hasn’t been
>> compiled as a fat binary. That is, doesn’t supply all architectures and it
>> more specifically doesn’t supply the architecture for what the Apache web
>> server is running as. This issue though hasn’t generally existed for ages
>> though as everything should be 64bit in MacOS X now.
>>
>> Graham
>>
>>> On 24 Aug 2016, at 5:52 AM, Teemu Korpijaakko <tko...@ <>gmail.com
>>> <http://gmail.com/>> wrote:
>>>
>>> So mod_wsgi-express seems like a lovely way to quickly deploy a fairly
>>> simple Flask application that I have, but I've run into an issue that I
>>> can't seem to solve. It's probably pretty simple though...my Flask
>>> application runs fine with the dev server included with Flask. When I
>>> attempt to run the same application using mod_wsgi-express start-server, it
>>> fails. Looking at the error log, I can see that i fails because the Oracle
>>> Instant client fails to load. How can I fix this? Python and Flask are
>>> all installed in a virtualenv.
>>>
>>> OS X El Capitan 10.11.6
>>>
>>> wsgi.py:
>>> from app import app as application
>>>
>>> snippet of error_log:
>>> [Tue Aug 23 12:47:05.771184 2016] [wsgi:error] [pid 1508] File
>>> "/Users/teemu/edge_tools/app/__init__.py", line 1, in <module>
>>>
>>> [Tue Aug 23 12:47:05.771210 2016] [wsgi:error] [pid 1508] import
>>> cx_Oracle
>>>
>>> [Tue Aug 23 12:47:05.771225 2016] [wsgi:error] [pid 1508] ImportError:
>>> dlopen(/Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so,
>>> 2): Library not loaded:
>>> /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1
>>>
>>> [Tue Aug 23 12:47:05.771229 2016] [wsgi:error] [pid 1508] Referenced
>>> from: /Users/teemu/edge_tools/flask/lib/python2.7/site-packages/cx_Oracle.so
>>>
>>> [Tue Aug 23 12:47:05.771231 2016] [wsgi:error] [pid 1508] Reason: image
>>> not found
>>>
>>> [Tue Aug 23 12:47:46.005206 2016] [mpm_prefork:notice] [pid 1506] AH00169:
>>> caught SIGTERM, shutting down
>>>
>>
>>
>> --
>> 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 https://groups.google.com/group/modwsgi
>> <https://groups.google.com/group/modwsgi>.
>> For more options, visit https://groups.google.com/d/optout
>> <https://groups.google.com/d/optout>.
>
>
> --
> 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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
--
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 https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.