Try setting and exporting it in:

    /tmp/mod_wsgi-localhost:8000:501/envvars

Then see if in environ script output in browser.

I can’t think how I would be stripping it out in mod_wsgi-express wrapper.

Graham

> On 25 Aug 2016, at 10:08 AM, Teemu Korpijaakko <[email protected]> wrote:
> 
> I've done that and nothing changes.  Also, if I export DYLD_LIBRARY_PATH 
> right before running mod_wsgi-express, I still don't see it listed in the 
> envvar output?  
> 
> This is confusing me!
> 
> On Wednesday, August 24, 2016 at 7:58:38 PM UTC-4, Graham Dumpleton wrote:
> Crap, gave you wrong URL for test app. I meant:
> 
> https://raw.githubusercontent.com/GrahamDumpleton/mod_wsgi/develop/tests/environ.wsgi
>  
> <https://raw.githubusercontent.com/GrahamDumpleton/mod_wsgi/develop/tests/environ.wsgi>
> 
> Doesn’t matter.
> 
> If the directory /ade/b/3071542110/oracle/rdbms/lib doesn’t exist, then 
> output form ‘otool -L’ isn’t what I expect. You had:
> 
> /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)
> 
> Based on that, the directory '/ade/b/3071542110/oracle/rdbms/lib’ should 
> exist and should contain the file 'libclntsh.dylib.11.1’.
> 
> If it doesn’t, fine where 'libclntsh.dylib.11.1’ is located and set 
> DYLD_LIBRARY_PATH to the directory it is in.
> 
> Graham
> 
>> On 25 Aug 2016, at 9:54 AM, Teemu Korpijaakko <tko...@ <>gmail.com 
>> <http://gmail.com/>> wrote:
>> 
>> Oh, right!  The browser window...there I see Hello World!
>> 
>> That folder doesn't exist on the machine, but if I export first, I get the 
>> same result.  500 Internal Server Error and the same error in error_log.
>> 
>> 
>> 
>> On Wed, Aug 24, 2016 at 7:32 PM, Graham Dumpleton <graham.d...@ <>gmail.com 
>> <http://gmail.com/>> wrote:
>> For the environ WSGI script. The values of DYLD variables was interested in 
>> was what was shown in the browser window, not console. But then that wasn’t 
>> in console anyway, means shouldn’t be in browser either.
>> 
>> I don’t understand why it would be required, but try setting:
>> 
>>     export DYLD_LIBRARY_PATH=/ade/b/3071542110/oracle/rdbms/lib
>> 
>> before running mod_wsgi-express.
>> 
>> This would normally be the solution, but don’t understand why would if 
>> ‘otool -L’ resolves properly.
>> 
>> Graham
>> 
>>> On 25 Aug 2016, at 9:23 AM, Teemu Korpijaakko <tko...@ <>gmail.com 
>>> <http://gmail.com/>> wrote:
>>> 
>>> I'm nearly 100% certain that I unset it when I ran 'otool -L'
>>> 
>>> Anyway, so the apachectl script is as expected.
>>> 
>>> Here's the output after adding env to envvars:
>>> 
>>> Server URL         : http://localhost:8000/ <http://localhost:8000/>
>>> Server Root        : /tmp/mod_wsgi-localhost:8000:501
>>> 
>>> Server Conf        : /tmp/mod_wsgi-localhost:8000:501/httpd.conf
>>> 
>>> Error Log File     : /tmp/mod_wsgi-localhost:8000:501/error_log (warn)
>>> 
>>> Request Capacity   : 5 (1 process * 5 threads)
>>> 
>>> Request Timeout    : 60 (seconds)
>>> 
>>> Queue Backlog      : 100 (connections)
>>> 
>>> Queue Timeout      : 45 (seconds)
>>> 
>>> Server Capacity    : 20 (event/worker), 20 (prefork)
>>> 
>>> Server Backlog     : 500 (connections)
>>> 
>>> Locale Setting     : en_US.UTF-8
>>> 
>>> MOD_WSGI_MODULES_DIRECTORY=/usr/libexec/apache2
>>> 
>>> MOD_WSGI_SERVER_ROOT=/tmp/mod_wsgi-localhost:8000:501
>>> 
>>> SHELL=/bin/bash
>>> 
>>> TERM=xterm-256color
>>> 
>>> SSH_CLIENT=192.168.254.106 56498 22
>>> 
>>> TMPDIR=/var/folders/wd/kg12dkg908n42nzf75w6pr540000gn/T/
>>> 
>>> SSH_TTY=/dev/ttys003
>>> 
>>> LC_ALL=en_US.UTF-8
>>> 
>>> USER=teemu
>>> 
>>> MOD_WSGI_LISTENER_HOST=localhost
>>> 
>>> __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
>>> 
>>> PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
>>> 
>>> MAIL=/var/mail/teemu
>>> 
>>> MOD_WSGI_HTTPS_PORT=None
>>> 
>>> VERSIONER_PYTHON_VERSION=2.7
>>> 
>>> PWD=/Users/teemu/edge_tools
>>> 
>>> LANG=en_US.UTF-8
>>> 
>>> MOD_WSGI_HTTP_PORT=8000
>>> 
>>> HOME=/Users/teemu
>>> 
>>> SHLVL=2
>>> 
>>> MOD_WSGI_GROUP=staff
>>> 
>>> MOD_WSGI_USER=teemu
>>> 
>>> LOGNAME=teemu
>>> 
>>> MOD_WSGI_WORKING_DIRECTORY=/Users/teemu/edge_tools
>>> 
>>> VERSIONER_PYTHON_PREFER_32_BIT=no
>>> 
>>> SSH_CONNECTION=192.168.254.106 56498 192.168.101.61 22
>>> 
>>> _=/usr/bin/env
>>> 
>>> 
>>> I don't see DYLD_LIBRARY_PATH there.
>>> 
>>> When I run you test application, I see the following output:
>>> 
>>> Teemus-Mac-mini:edge_tools teemu$ flask/bin/mod_wsgi-express start-server 
>>> events.wsgi
>>> 
>>> Server URL         : http://localhost:8000/ <http://localhost:8000/>
>>> Server Root        : /tmp/mod_wsgi-localhost:8000:501
>>> 
>>> Server Conf        : /tmp/mod_wsgi-localhost:8000:501/httpd.conf
>>> 
>>> Error Log File     : /tmp/mod_wsgi-localhost:8000:501/error_log (warn)
>>> 
>>> Request Capacity   : 5 (1 process * 5 threads)
>>> 
>>> Request Timeout    : 60 (seconds)
>>> 
>>> Queue Backlog      : 100 (connections)
>>> 
>>> Queue Timeout      : 45 (seconds)
>>> 
>>> Server Capacity    : 20 (event/worker), 20 (prefork)
>>> 
>>> Server Backlog     : 500 (connections)
>>> 
>>> Locale Setting     : en_US.UTF-8
>>> 
>>> MOD_WSGI_MODULES_DIRECTORY=/usr/libexec/apache2
>>> 
>>> MOD_WSGI_SERVER_ROOT=/tmp/mod_wsgi-localhost:8000:501
>>> 
>>> SHELL=/bin/bash
>>> 
>>> TERM=xterm-256color
>>> 
>>> SSH_CLIENT=192.168.254.106 56498 22
>>> 
>>> TMPDIR=/var/folders/wd/kg12dkg908n42nzf75w6pr540000gn/T/
>>> 
>>> SSH_TTY=/dev/ttys003
>>> 
>>> LC_ALL=en_US.UTF-8
>>> 
>>> USER=teemu
>>> 
>>> MOD_WSGI_LISTENER_HOST=localhost
>>> 
>>> __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
>>> 
>>> PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
>>> 
>>> MAIL=/var/mail/teemu
>>> 
>>> MOD_WSGI_HTTPS_PORT=None
>>> 
>>> VERSIONER_PYTHON_VERSION=2.7
>>> 
>>> PWD=/Users/teemu/edge_tools
>>> 
>>> LANG=en_US.UTF-8
>>> 
>>> MOD_WSGI_HTTP_PORT=8000
>>> 
>>> HOME=/Users/teemu
>>> 
>>> SHLVL=2
>>> 
>>> MOD_WSGI_GROUP=staff
>>> 
>>> MOD_WSGI_USER=teemu
>>> 
>>> LOGNAME=teemu
>>> 
>>> MOD_WSGI_WORKING_DIRECTORY=/Users/teemu/edge_tools
>>> 
>>> VERSIONER_PYTHON_PREFER_32_BIT=no
>>> 
>>> SSH_CONNECTION=192.168.254.106 56498 192.168.101.61 22
>>> 
>>> _=/usr/bin/env
>>> 
>>> 
>>> 
>>> Again, no DYLD_LIBRARY_PATH set
>>> 
>>> 
>>> 
>>> FWIW,  I have the Oracle file in /Users/teemu/edge_tools/oracle.  This 
>>> seems to work fine for simply import cx_Oracle in the interpreter.  Setting 
>>> DYLD_LIBRARY_PATH to whatever you end up configuring as ORACLE_HOME appears 
>>> to be SOP for the installation.  In order to get cx_Oracle to install 
>>> properly, I had to set ORACLE_HOME and DYLD_LIBRARY_PATH to 
>>> /Users/teemu/edge_tools/oracle
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On Wednesday, August 24, 2016 at 6:44:11 PM UTC-4, Graham Dumpleton wrote:
>>> 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 <tko...@ <>gmail.com 
>>>> <http://gmail.com/>> 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 <tko...@ <>gmail.com 
>>>>> <http://gmail.com/>> 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 modwsgi+u...@ <>googlegroups. <http://googlegroups.com/>com 
>>>>> <http://googlegroups.com/>.
>>>>> To post to this group, send email to mod...@ <>googlegroups.com 
>>>>> <http://googlegroups.com/>.
>>>>> 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 modwsgi+u...@ <>googlegroups. <http://googlegroups.com/>com 
>>>> <http://googlegroups.com/>.
>>>> To post to this group, send email to mod...@ <>googlegroups.com 
>>>> <http://googlegroups.com/>.
>>>> 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 modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>.
>>> To post to this group, send email to mod...@ <>googlegroups.com 
>>> <http://googlegroups.com/>.
>>> 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 a topic in the 
>> Google Groups "modwsgi" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/modwsgi/DjR37hyY6Q4/unsubscribe 
>> <https://groups.google.com/d/topic/modwsgi/DjR37hyY6Q4/unsubscribe>.
>> To unsubscribe from this group and all its topics, send an email to 
>> modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>.
>> To post to this group, send email to mod...@ <>googlegroups.com 
>> <http://googlegroups.com/>.
>> 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 modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>.
>> To post to this group, send email to mod...@ <>googlegroups.com 
>> <http://googlegroups.com/>.
>> 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.

Reply via email to