
Php, Oracle on Mac, with strange behaviour
Dear List,
I have a puzzler, which I can't seem to fix.
To summarise, I have installed PHP, apache from source and the oracle
client (details below). I then construct a simple PHP script to
connect to my oracle database.
When I run the script from the command line, it works perfectly, and
returns rows from the database.
bash$ php oracle.php
Using : /opt/oracle/instanceclient, ORACLE_HOME=/opt/oracle/
instanceclient
Successfully connected to Oracle.
<table border="1"><tr><td>71</td><td>71</td><td>421.4983</
td><td>421.4983</td><td>C23 H27 N5 O3</td><td>C23 H27 N5 O3</td>
Buuuut, when I try to view this through a browser, it returns this
error:
Using : /opt/oracle/instanceclient, ORACLE_HOME=/opt/oracle/
instanceclient
Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
There is something wrong with your system - please check that
LD_LIBRARY_PATH includes the directory with Oracle Instant Client
libraries in/Library/WebServer/Documents/oracle.php on line 25
Oracle Connect Error
Here are the details of my installation and a few things I have tried:
Apache:
Installed apache (httpd-2.2.11) with the following configuration: --
prefix=/usr/local/apache --enable-module=so
No Errors
PHP
Installed PHP (php-5.2.9) with the following configuration:
--with-apxs2 -enable-cli --with-mysql=/usr/local/mysql/ --exec-
prefix=/usr --localstatedir=/var --libexecdir=/System/Library/Apache
/Modules --enable-shared=max --with-gd=/usr/local --with-zlib --
with-oci8=instantclient,/opt/oracle/instanceclient -enable-layout
=Darwin -enable-mods-shared=all --with-apxs2=/usr/local/apache2/bin/
apxs --with-config-file-path=/usr/local/apache2/conf --enable-si
gchild
No errors
Oracle Client
Installed Basic + all others in /opt/oracle/instanceclient
No errors
Oracle (Version 11g) is installed on a different server
I will paste the PHP script I am using at the bottom of the mail.
Now, as I said, it is working fine through the command line, so
everything is setup fine, so I figure it must be a permissions problem.
Hence, I chmod -R 755 $ORACLE_HOME and have tried running apache as
lots of different users, but to no avail
Thanks in advance
Mark
##### PHP SCRIPT #####
<?php
putenv("ORACLE_SID=orcl");
putenv("LD_LIBRARY_PATH=/opt/oracle/instanceclient");
$username = "#####";### I have hidden this for security
$passwd = "#####"; ### I have hidden this for security
echo("Using : ". getenv("LD_LIBRARY_PATH"));
echo ", ORACLE_HOME=".getenv("ORACLE_HOME");
$db="(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)
(HOST=########)(PORT=1521) ### I have hidden this for
security
)
(CONNECT_DATA=(SERVER=DEDICATED)(SID=orcl)
(SERVICE_NAME=orcl))
)";
if ($c = OCILogon($username,$passwd,$db)) {
echo "Successfully connected to Oracle.n";
$s = OCIParse($c, "select * from COMPOUNDS WHERE rownum=1");
OCIExecute($s, OCI_DEFAULT);
print '<table border="1">';
while ($row = oci_fetch_array($s, OCI_RETURN_NULLS)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?
htmlentities($item):' ').'</td>';
}
print '</tr>';
}
OCILogoff($c);
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text]. " ".
$err[message];
}
echo("
\n");
##### END #####
_____________________________
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 [at] icr.ac.uk
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.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
> Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
> There is something wrong with your system - please check that
> LD_LIBRARY_PATH includes the directory with Oracle Instant Client
> libraries in/Library/WebServer/Documents/oracle.php on line 25
> Oracle Connect Error
<snip>
> putenv("LD_LIBRARY_PATH=/opt/oracle/instanceclient");
I'd guess you probably need this in apache's start up script, not in php
(where that is on a mac setup I have no idea).
You could also try it in your virtual host:
http://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv
SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
Chris wrote:
>> Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
>> There is something wrong with your system - please check that
>> LD_LIBRARY_PATH includes the directory with Oracle Instant Client
>> libraries in/Library/WebServer/Documents/oracle.php on line 25
>> Oracle Connect Error
>
> <snip>
>
>> putenv("LD_LIBRARY_PATH=/opt/oracle/instanceclient");
>
> I'd guess you probably need this in apache's start up script, not in php
> (where that is on a mac setup I have no idea).
>
> You could also try it in your virtual host:
>
> http://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv
>
> SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
>
I agree that using putenv() for Environment variables in scripts is bad.
On Mac, I think you need DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH.
See http://www.oracle.com/technology/pub/articles/bibbs-php-leop ard.html
Chris
--
Email: christopher.jones [at] oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
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.
Cheers
Mark
On 16 Mar 2009, at 1:26 AM, Christopher Jones wrote:
>
>
> Chris wrote:
>>> Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate()
>>> failed. There is something wrong with your system - please check
>>> that LD_LIBRARY_PATH includes the directory with Oracle
>>> Instant Client libraries in/Library/WebServer/Documents/oracle.php
>>> on line 25 Oracle Connect Error
>> <snip>
>>> putenv("LD_LIBRARY_PATH=/opt/oracle/instanceclient");
>> I'd guess you probably need this in apache's start up script, not
>> in php (where that is on a mac setup I have no idea).
>> You could also try it in your virtual host:
>> http://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv
>> SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
>
> I agree that using putenv() for Environment variables in scripts is
> bad.
> On Mac, I think you need DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH.
> See http://www.oracle.com/technology/pub/articles/bibbs-php-leop ard.html
>
> Chris
>
> --
> Email: christopher.jones [at] oracle.com Tel: +1 650 506 8630
> Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM
_____________________________
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 [at] icr.ac.uk
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.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
On Mon, Mar 16, 2009 at 6:51 PM, Mark Halling-Brown
<mhallingbrown [at] icr.ac.uk> 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.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
--Apple-Mail-158--960098727
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit
>
> Did you restart apache after doing this?
Yes, many times
>
> The env variables are set correctly for your user, but not apache's
> (which is the problem).
Indeed, I have removed the putenv declarations in the php script and
inserted this:
echo("Using LD_LIBRARY_PATH: ". getenv("LD_LIBRARY_PATH"));
echo ", ORACLE_HOME=".getenv("ORACLE_HOME");
echo(", DYLD_LIBRARY_PATH: ". getenv("DYLD_LIBRARY_PATH"));
And it prints to the screen (browser) correctly:
Using LD_LIBRARY_PATH: /opt/oracle/instanceclient, ORACLE_HOME=/opt/
oracle/instanceclient, DYLD_LIBRARY_PATH: /opt/oracle/instanceclient
For completeness, I have also put the variables is /etc/profile, /etc/
bash_profile etc
So it seems that the variables are set up for sure (unless this is
just for php, but I do have these variables in the apache httpd.conf)
This is a puzzler
Cheers
Mark
>
>
> Does the mac have an /etc/environment file? That should cover all
> users.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
_____________________________
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 [at] icr.ac.uk
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.
--Apple-Mail-158--960098727--
Re: Php, Oracle on Mac, with strange behaviour
On/El 16/03/09 09:23, chris smith wrote/escribió:
> On Mon, Mar 16, 2009 at 6:51 PM, Mark Halling-Brown
> <mhallingbrown [at] icr.ac.uk> 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.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
--Apple-Mail-159--950738599
Content-Type: text/plain;
charset=ISO-8859-1;
format=flowed;
delsp=yes
Content-Transfer-Encoding: quoted-printable
Hi Grant,
Thanks to your instructions, I am making a b it of prog=
ress.
I have entered the PassEnv commands into the=2 0https.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 th rough correc=
tly, 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/a=
pachectl
restart) and it complains that:
[Mon Mar 16 11:08:53 2009] [warn] PassEnv vari able LD_LIBR=
ARY_PATH was
undefined
So I am guessing that root has not pic ked 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_profile etc, but I=
still
seems root doesn't know about them.
Have you any idea where I need to set thes e variables =
(Is there a root
home directory I can edit a .bash_profile or=2 0something?)
I did edit the /System/Library/LaunchDaemons/org.apa che.httpd.plis=
t
file, but the apache I am using was compiled from sour=
ce, 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/escrib i=F3:
>> On Mon, Mar 16, 2009 at 6:51 PM, Mark=2 0Halling-Brown=
>> <mhallingbrown [at] icr.ac.uk> wrote:
>>
>>> Thanks for your replies.
>>> In my desperation, I declared those enviro nment variab=
les in as
>>> many places
>>> as I could think of. The script (Althoug h 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/instanceclien t
>>> SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient
>>> SetEnv ORACLE_BASE /opt/oracle/instanceclient
>>>
>>> But given that it works on the command=2 0line, but =
not through the
>>> browser, I
>>> think that the environment variables must be set cor=
rectly.
>>>
>>
>> Did you restart apache after doing this?
>>
>> The env variables are set correctly for y our user, =
but not apache's
>> (which is the problem).
>>
>> Does the mac have an /etc/environment=2 0file? That =
should cover all
>> users.
>
> Unfortunately not although with the stock/supp lied Apache =
web server
> there is a plist file you can edit to add environm=
ent settings. Edit
> |/System/Library/LaunchDaemons/org.apache.httpd.plist,=2 0adding the =
> relevant environment variable key/value informat ion:|
>
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http=
://www.apple.com/DTDs/PropertyList-1.0.dtd
> ">
> <plist version=3D"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 t hese values =
through to PHP.
> The SetEnv directive in Apache is not the= 20same as =
"setenv" or
> "export" in csh/bash/etc. Apache maintains its own symbo=
l table for
> environment variables. Unless the OCI8 extensi on calls a=
pache_getenv
> those declarations will have no effect.
>
> regards
>
> grant
>
> --
> Grant Croker - Ingres PHP and Ruby maintai ner
> http://blogs.planetingres.org/grant
> Generally, old media don't die. They just have to gr=
ow old gracefully.
> Guess what, we still have stone masons. Th ey haven't =
been the primary
> purveyors of the written word for a while= 20now of c=
ourse, 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 Ther apeutics,
The Institute of Cancer Research
15 Cotswold Road
Belmont, Surrey SM2 5NG, UK
Tel: (+44)-20-8722-4300 (ext: 4659)
Email: mhallingbrown [at] icr.ac.uk
Web: http://www.markyhb.co.uk
"A cynic is what an idealist calls a realist "
The Institute of Cancer Research: Royal Cancer=2 0Hospital, a=
charitable Company Limited by Guarantee, Regist ered in En=
gland under Company No. 534147 with its Regist ered Office =
at 123 Old Brompton Road, London SW7 3RP.
This e-mail message is confidential and for us e by the =
addressee only. If the message is received by anyone =
other than the addressee, please return the me ssage to t=
he sender by replying to it and then delete= 20the messag=
e from your computer and network.
--Apple-Mail-159--950738599--
Re: Php, Oracle on Mac, with strange behaviour
--------------010104050308020808080306
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Hi Mark,
you are right /System/Library/LaunchDaemons/org.apache.httpd.plist will
not work in your case, it's for the Mac OS X supplied Apache. In your
case you can edit /usr/local/apache2/bin/apachectl adding the following:
DYLD_LIBRARY_PATH=/opt/oracle/instanceclient
LD_LIBRARY_PATH=/opt/oracle/instanceclient
ORACLE_BASE=/opt/oracle/instanceclient
ORACLE_HOME=/opt/oracle/instanceclient
export DYLD_LIBRARY_PATH LD_LIBRARY_PATH ORACLE_BASE ORACLE_HOME
(note: As Chris Jones mentioned LD_LIBRARY_PATH is not used on OS X,
however there is no harm in having it set)
Place the above some where near the top of apachectl, I cannot tell you
exactly since fink will not install and MacPorts does not build SQLite3.
Restart apache and you should see the correct values in getenv() or
phpinfo().
regards
grant
On/El 16/03/09 12:13, Mark Halling-Brown wrote/escribió:
> 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
>
--
Grant Croker - Ingres PHP and Ruby maintainer
http://blogs.planetingres.org/grant
It was so much easier to blame it on Them. It was bleakly depressing to think that They were Us. If it was Them, then nothing was anyone's fault. If it was us, what did that make Me? After all, I'm one of Us. I must be. I've certainly never thought of myself as one of Them. No one ever thinks of themselves as one of Them. We're always one of Us. It's Them that do the bad things.
-- Terry Pratchett, Jingo
--------------010104050308020808080306--
Re: Php, Oracle on Mac, with strange behaviour
Grant, thank you very much. You are a life=2 0saver. This=
worked perfectly.
Thanks again
Mark
On 16 Mar 2009, at 11:53 AM, Grant Croker wrote:
> Hi Mark,
>
> you are right /System/Library/LaunchDaemons/org.ap ache.httpd.pli=
st
> will not work in your case, it's for the Mac OS =
X supplied Apache.
> In your case you can edit /usr/local/apache2 /bin/apachectl=
adding
> the following:
>
> DYLD_LIBRARY_PATH=3D/opt/oracle/instanceclient
> LD_LIBRARY_PATH=3D/opt/oracle/instanceclient
> ORACLE_BASE=3D/opt/oracle/instanceclient
> ORACLE_HOME=3D/opt/oracle/instanceclient
> export DYLD_LIBRARY_PATH LD_LIBRARY_PATH ORACLE_BA SE ORACLE_HO=
ME
>
> (note: As Chris Jones mentioned LD_LIBRARY_PAT H is not =
used on OS X,
> however there is no harm in having it se t)
>
> Place the above some where near the top of apachectl=
, I cannot tell
> you exactly since fink will not install an d MacPorts =
does not build
> SQLite3. Restart apache and you should see=2 0the correct=
values in
> getenv() or phpinfo().
>
> regards
>
> grant
>
>
> On/El 16/03/09 12:13, Mark Halling-Brown wrote /escribi=F3:
>> Hi Grant,
>>
>> Thanks to your instructions, I am making a bit of =
progress.
>> I have entered the PassEnv commands into the https.co=
nf.:
>> 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 c=
orrectly, 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=2 0variable LD=
_LIBRARY_PATH
>> was undefined
>>
>> So I am guessing that root has not pick ed up any =
of the environment
>> variables that I have set in various plac es around =
my system. I
>> have put DYLD_LIBRARY_PATH in /etc/bashrc ~/. bash_profileet=
c, but I
>> still seems root doesn't know about them.
>>
>> Have you any idea where I need to set=2 0these varia=
bles (Is there a
>> root home directory I can edit a bash_pro file or so=
mething?)
>>
>> I did edit the /System/Library/LaunchDaemons/or g.apache.httpd=
..plist
>> file, but the apache I am using was com piled from =
source, so I fear
>> it wont work list that plist?
>>
>> Thanks for all your help
>> Mark
>>
>
>
> --
> Grant Croker - Ingres PHP and Ruby maintai ner
> http://blogs.planetingres.org/grant
> It was so much easier to blame it on T hem. It wa=
s bleakly depressing
> to think that They were Us. If it was Them, then =
nothing was
> anyone's fault. If it was us, what did t hat make M=
e? After all, I'm
> one of Us. I must be. I've certainly nev er thought =
of myself as one
> of Them. No one ever thinks of themselves= 20as one o=
f Them. We're
> always one of Us. It's Them that do the= 20bad things=
..
> -- Terry Pratchett, Jingo
>
_____________________________
Mark Halling-Brown
Higher Scientific Officer,
Computational Biology & Chemogenomics, Cancer Ther apeutics,
The Institute of Cancer Research
15 Cotswold Road
Belmont, Surrey SM2 5NG, UK
Tel: (+44)-20-8722-4300 (ext: 4659)
Email: mhallingbrown [at] icr.ac.uk
Web: http://www.markyhb.co.uk
"A cynic is what an idealist calls a realist "
The Institute of Cancer Research: Royal Cancer=2 0Hospital, a=
charitable Company Limited by Guarantee, Regist ered in En=
gland under Company No. 534147 with its Regist ered Office =
at 123 Old Brompton Road, London SW7 3RP.
This e-mail message is confidential and for us e by the =
addressee only. If the message is received by anyone =
other than the addressee, please return the me ssage to t=
he sender by replying to it and then delete= 20the messag=
e from your computer and network.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
On/El 16/03/09 13:03, Mark Halling-Brown wrote/escribió:
> Grant, thank you very much. You are a life saver. This worked perfectly.
>
> Thanks again
> Mark
>
No problem,
g
--
Grant Croker - Ingres PHP and Ruby maintainer
http://blogs.planetingres.org/grant
It was so much easier to blame it on Them. It was bleakly depressing to think that They were Us. If it was Them, then nothing was anyone's fault. If it was us, what did that make Me? After all, I'm one of Us. I must be. I've certainly never thought of myself as one of Them. No one ever thinks of themselves as one of Them. We're always one of Us. It's Them that do the bad things.
-- Terry Pratchett, Jingo
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Php, Oracle on Mac, with strange behaviour
Grant Croker wrote:
> DYLD_LIBRARY_PATH=/opt/oracle/instanceclient
> LD_LIBRARY_PATH=/opt/oracle/instanceclient
> ORACLE_BASE=/opt/oracle/instanceclient
> ORACLE_HOME=/opt/oracle/instanceclient
> export DYLD_LIBRARY_PATH LD_LIBRARY_PATH ORACLE_BASE ORACLE_HOME
>
> (note: As Chris Jones mentioned LD_LIBRARY_PATH is not used on OS X,
> however there is no harm in having it set)
Thanks for your help getting this resolved.
FWIW, I just merged a change to the originally reported "Warning:
ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed." message.
On Mac OS X this now mentions DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH:
http://cvs.php.net/viewvc.cgi/pecl/oci8/oci8.c?r1=1.269.2.16 .2.38.2.31&r2=1.269.2.16.2.38.2.32
This fix is incorporated into OCI8 1.3.5 downloadable from
http://pecl.php.net/package/oci8 It will be available with PHP 5.3
(whenever that comes out). Users of older versions of PHP including
PHP 5.2 are encouraged to upgrade OCI8 using PECL.
Chris
--
Email: christopher.jones [at] oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php