Hi Grant,
Thanks to your instructions, I am making a bit of progress.
I have entered the PassEnv commands into the https.conf.:
SetEnv DYLD_LIBRARY_PATH /opt/oracle/instanceclient
SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
PassEnv DYLD_LIBRARY_PATH
PassEnv LD_LIBRARY_PATH
It now seems that this variable is passed through correctly, but it is
not as I set it. Instead it states:
DYLD_LIBRARY_PATH: /usr/local/apache2/lib:
I restart apache as root user (sudo /usr/local/apache2/bin/apachectl
restart) and it complains that:
[Mon Mar 16 11:08:53 2009] [warn] PassEnv variable LD_LIBRARY_PATH was
undefined
So I am guessing that root has not picked up any of the environment
variables that I have set in various places around my system. I have
put DYLD_LIBRARY_PATH in /etc/bashrc ~/.bash_profileetc, but I still
seems root doesn't know about them.
Have you any idea where I need to set these variables (Is there a root
home directory I can edit a .bash_profile or something?)
I did edit the /System/Library/LaunchDaemons/org.apache.httpd.plist
file, but the apache I am using was compiled from source, so I fear it
wont work list that plist?
Thanks for all your help
Mark
On 16 Mar 2009, at 10:27 AM, Grant Croker wrote:
On/El 16/03/09 09:23, chris smith wrote/escribió:
On Mon, Mar 16, 2009 at 6:51 PM, Mark Halling-Brown
<mhallingbrown@xxxxxxxxx> wrote:
Thanks for your replies.
In my desperation, I declared those environment variables in as
many places
as I could think of. The script (Although I know I shouldnt),
php.ini and
also the apache httpd.conf file:
SetEnv ORACLE_HOME /opt/oracle/instanceclient
SetEnv DYLD_LIBRARY_PATH /opt/oracle/instanceclient
SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
SetEnv ORACLE_BASE /opt/oracle/instanceclient
But given that it works on the command line, but not through the
browser, I
think that the environment variables must be set correctly.
Did you restart apache after doing this?
The env variables are set correctly for your user, but not apache's
(which is the problem).
Does the mac have an /etc/environment file? That should cover all
users.
Unfortunately not although with the stock/supplied Apache web server
there is a plist file you can edit to add environment settings. Edit
|/System/Library/LaunchDaemons/org.apache.httpd.plist, adding the
relevant environment variable key/value information:|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>DYLD_LIBRARY_PATH</key>
<string>path goes here</string>
<key>ORACLE_HOME</key>
<string>path goes here</string>
<key>ORACLE_BASE</key>
<string>path goes here</string>
</dict>
<key>Label</key>
<string>org.apache.httpd</string>
.
.
.
</dict>
</plist>
Then you use PassEnv in Apache to pass these values through to PHP.
The SetEnv directive in Apache is not the same as "setenv" or
"export" in csh/bash/etc. Apache maintains its own symbol table for
environment variables. Unless the OCI8 extension calls apache_getenv
those declarations will have no effect.
regards
grant
--
Grant Croker - Ingres PHP and Ruby maintainer
http://blogs.planetingres.org/grant
Generally, old media don't die. They just have to grow old gracefully.
Guess what, we still have stone masons. They haven't been the primary
purveyors of the written word for a while now of course, but they
still
have a role because you wouldn't want a TV screen on your headstone.
_____________________________
Mark Halling-Brown
Higher Scientific Officer,
Computational Biology & Chemogenomics, Cancer Therapeutics,
The Institute of Cancer Research
15 Cotswold Road
Belmont, Surrey SM2 5NG, UK
Tel: (+44)-20-8722-4300 (ext: 4659)
Email: mhallingbrown@xxxxxxxxx
Web: http://www.markyhb.co.uk
"A cynic is what an idealist calls a realist"
The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.