oci_connect
am 20.11.2008 02:15:47 von Fred Silsbee
I have the following in /etc/httpd/conf/httpd.conf
SetEnv ORACLE_HOSTNAME localhost.localdomain
SetEnv TNS_ADMIN /u01/app/oracle/product/11.1.0/db_1/network/admin
SetEnv ORACLE_BASE /u01/app/oracle
SetEnv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1
SetEnv ORACLE_SID lmkiiiGDNSID
SetEnv ORACLE_TERM xterm
SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
but showing in phpinfo is:
oci8
OCI8 Support enabled
Version 1.3.4
Revision $Revision: 1.269.2.16.2.38.2.20 $
Active Persistent Connections 0
Active Connections 0
Compile-time ORACLE_HOME no value ??????????????
Libraries Used no value
Temporary Lob support enabled
Collections support enabled
Directive Local Value Master Value
oci8.connection_class no value no value
oci8.default_prefetch 100 100
oci8.events Off Off
oci8.max_persistent -1 -1
oci8.old_oci_close_semantics Off Off
oci8.persistent_timeout -1 -1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20
NOTHING about Oracle in php.ini but there is a section about MySQL
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: oci_connect
am 20.11.2008 02:57:53 von Christopher Jones
Fred Silsbee wrote:
> I have the following in /etc/httpd/conf/httpd.conf
>
> SetEnv ORACLE_HOSTNAME localhost.localdomain
> SetEnv TNS_ADMIN /u01/app/oracle/product/11.1.0/db_1/network/admin
> SetEnv ORACLE_BASE /u01/app/oracle
> SetEnv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1
> SetEnv ORACLE_SID lmkiiiGDNSID
> SetEnv ORACLE_TERM xterm
> SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
I personally don't set them in httpd.conf because I don't believe
putting them there works consistently across platforms. And we can't
cross check your site because you haven't yet mailed the information I
requested in more than one email/post.
And I really doubt LD_LIBRARY_PATH being set before Apache executable
starts is a good idea.
I strongly suggest you set the environment in the shell that starts
Apache:
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export ORACLE_SID=lmkiiiGDNSID
export LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
/usr/sbin/apachectl start
(The other variables aren't needed)
You may need to make sure these are set at boot time, if you Apache
starts at machine boot.
> but showing in phpinfo is:
>
>
> oci8
> OCI8 Support enabled
> Version 1.3.4
> Revision $Revision: 1.269.2.16.2.38.2.20 $
> Active Persistent Connections 0
> Active Connections 0
> Compile-time ORACLE_HOME no value ??????????????
> Libraries Used no value
> Temporary Lob support enabled
> Collections support enabled
>
> Directive Local Value Master Value
> oci8.connection_class no value no value
> oci8.default_prefetch 100 100
> oci8.events Off Off
> oci8.max_persistent -1 -1
> oci8.old_oci_close_semantics Off Off
> oci8.persistent_timeout -1 -1
> oci8.ping_interval 60 60
> oci8.privileged_connect Off Off
> oci8.statement_cache_size 20 20
These values are not relevant to your problem.
What is in the section with the heading "Environment"? Check for the
ORACLE_HOME and ORACLE_SID variables there.
On RHEL 5.2, if I use SetEnv in httpd.conf, I only see the variables
in the "Apache Environment" section and not the "Environment" section
of phpinfo().
> NOTHING about Oracle in php.ini but there is a section about MySQL
That's fine. Nothing needs to be set. Everything has a default. You
can see the defaults in phpinfo output, and they are mostly tuning
settings. You can add any configuration setting you want to change.
Nothing there will affect a basic connection test script like the one
you previously posted.
Chris
--
Email: christopher.jones@oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/f8jad
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: oci_connect
am 20.11.2008 03:46:24 von Daniel Brown
On Wed, Nov 19, 2008 at 8:15 PM, Fred Silsbee wrote:
[snip!]
"Fred,"
Please keep all of your posts in the same thread with the same
subject. You're making it very difficult for others to follow along
with your ramblings, and seem to even be confusing yourself a bit.
Chris has been trying to get the information he needs from you, but it
looks like you're running over yourself. It happens with frustration,
I completely understand. ;-P
Keep everything in one thread so that it's easy to follow and so
that Chris and others can help you out. Once you get the information
sorted out in one linear fashion, I think you'll find the problems
aren't as serious as you might have thought. And if they are, then we
can all help you to solve them.
--
http://www.parasane.net/
daniel.brown@parasane.net || danbrown@php.net
Ask me about our current hosting/dedicated server deals!
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: oci_connect
am 21.11.2008 06:12:08 von Fred Silsbee
IT WORKS!
in the file /etc/rc.d/init.d/httpd
I inserted statements starting with export position indicated by the surrounding code.
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/sbin/apachectl
httpd=${HTTPD-/usr/sbin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/run/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0
# new statements here
export ORACLE_HOSTNAME=localhost.localdomain
export TNS_ADMIN=/u01/app/oracle/product/11.1.0/db_1/network/admin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export ORACLE_SID=LMKIIIGDNSID
export LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
# new statements above
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
--- On Fri, 11/21/08, Christopher Jones wrote:
> From: Christopher Jones
> Subject: Re: [PHP-DB] oci_connect
> To: fredsilsbee@yahoo.com
> Date: Friday, November 21, 2008, 12:56 AM
> Unfortunately this is not the section titled
> "Environment".
>
> I'm hopping on a flight and will almost certainly
> not be able to read email until the end of next week.
>
> Please follow my suggestion in the post below about setting
> variables.
>
> Chris
>
> Fred Silsbee wrote:
> > Apache Environment
> > Variable Value
> > ORACLE_HOSTNAME localhost.localdomain
> > TNS_ADMIN
> /u01/app/oracle/product/11.1.0/db_1/network/admin
> > ORACLE_BASE /u01/app/oracle
> > ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1
> > ORACLE_SID lmkiiiGDNSID
> > ORACLE_TERM xterm
> > LD_LIBRARY_PATH
> /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
> > HTTP_HOST localhost:8080
> > HTTP_USER_AGENT Mozilla/5.0 (X11; U; Linux i686;
> en-US; rv:1.9.0.4) Gecko/2008111217 Fedora/3.0.4-1.fc9
> Firefox/3.0.4
> > HTTP_ACCEPT
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q= 0.8
> > HTTP_ACCEPT_LANGUAGE en-us,en;q=0.5
> > HTTP_ACCEPT_ENCODING gzip,deflate
> > HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > HTTP_KEEP_ALIVE 300
> > HTTP_CONNECTION keep-alive
> > PATH /sbin:/usr/sbin:/bin:/usr/bin
> > SERVER_SIGNATURE Apache/2.2.9 (Fedora)
> Server at localhost Port 8080
> > SERVER_SOFTWARE Apache/2.2.9 (Fedora)
> > SERVER_NAME localhost
> > SERVER_ADDR 127.0.0.1
> > SERVER_PORT 8080
> > REMOTE_ADDR 127.0.0.1
> > DOCUMENT_ROOT /var/www/html
> > SERVER_ADMIN root@localhost
> > SCRIPT_FILENAME /var/www/html/phpinfo.php
> > REMOTE_PORT 56423
> > GATEWAY_INTERFACE CGI/1.1
> > SERVER_PROTOCOL HTTP/1.1
> > REQUEST_METHOD GET
> > QUERY_STRING no value
> > REQUEST_URI /phpinfo.php
> > SCRIPT_NAME /phpinfo.php
> >
> >
> > --- On Thu, 11/20/08, Christopher Jones
> wrote:
> >
> >> From: Christopher Jones
>
> >> Subject: Re: [PHP-DB] oci_connect
> >> To: fredsilsbee@yahoo.com
> >> Date: Thursday, November 20, 2008, 5:15 AM
> >> Fred Silsbee wrote:
> >>> what information did you request???
> >> See the sentence in my previous post that ends in
> a
> >> question mark.
> >>
> >> Chris
> >>
> >>>
> >>> --- On Thu, 11/20/08, Christopher Jones
> >> wrote:
> >>>> From: Christopher Jones
> >>
> >>>> Subject: Re: [PHP-DB] oci_connect
> >>>> To: fredsilsbee@yahoo.com
> >>>> Cc: php-db@lists.php.net
> >>>> Date: Thursday, November 20, 2008, 1:57 AM
> >>>> Fred Silsbee wrote:
> >>>>> I have the following in
> >> /etc/httpd/conf/httpd.conf
> >>>>> SetEnv ORACLE_HOSTNAME
> localhost.localdomain
> >>>>> SetEnv TNS_ADMIN
> >>>>
> /u01/app/oracle/product/11.1.0/db_1/network/admin
> >>>>> SetEnv ORACLE_BASE /u01/app/oracle
> >>>>> SetEnv ORACLE_HOME
> >> /u01/app/oracle/product/11.1.0/db_1
> >>>>> SetEnv ORACLE_SID lmkiiiGDNSID
> >>>>> SetEnv ORACLE_TERM xterm
> >>>>> SetEnv LD_LIBRARY_PATH
> >>
> /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
> >>>> I personally don't set them in
> httpd.conf
> >> because I
> >>>> don't believe
> >>>> putting them there works consistently
> across
> >> platforms.
> >>>> And we can't
> >>>> cross check your site because you
> haven't yet
> >> mailed
> >>>> the information I
> >>>> requested in more than one email/post.
> >>>>
> >>>> And I really doubt LD_LIBRARY_PATH being
> set
> >> before Apache
> >>>> executable
> >>>> starts is a good idea.
> >>>>
> >>>> I strongly suggest you set the environment
> in the
> >> shell
> >>>> that starts
> >>>> Apache:
> >>>>
> >>>> export
> >> ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
> >>>> export ORACLE_SID=lmkiiiGDNSID
> >>>> export LD_LIBRARY_PATH
> >>>>
> >>
> /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib
> >>>> /usr/sbin/apachectl start
> >>>>
> >>>> (The other variables aren't needed)
> >>>>
> >>>> You may need to make sure these are set at
> boot
> >> time, if
> >>>> you Apache
> >>>> starts at machine boot.
> >>>>
> >>>>> but showing in phpinfo is:
> >>>>>
> >>>>>
> >>>>> oci8
> >>>>> OCI8 Support enabled
> >>>>> Version 1.3.4
> >>>>> Revision $Revision:
> 1.269.2.16.2.38.2.20 $
> >>>>> Active Persistent Connections 0
> >>>>> Active Connections 0
> >>>>> Compile-time ORACLE_HOME no value
>
> >>
> >>>> ??????????????
> >>>>> Libraries Used no value
> >>>>> Temporary Lob support enabled
> >>>>> Collections support enabled
> >>>>>
> >>>>> Directive Local Value Master Value
> >>>>> oci8.connection_class no value no
> value
> >>>>> oci8.default_prefetch 100 100
> >>>>> oci8.events Off Off
> >>>>> oci8.max_persistent -1 -1
> >>>>> oci8.old_oci_close_semantics Off Off
> >>>>> oci8.persistent_timeout -1 -1
> >>>>> oci8.ping_interval 60 60
> >>>>> oci8.privileged_connect Off Off
> >>>>> oci8.statement_cache_size 20 20
> >>>> These values are not relevant to your
> problem.
> >>>>
> >>>> What is in the section with the heading
> >>>> "Environment"? Check for the
> >>>> ORACLE_HOME and ORACLE_SID variables
> there.
> >>>>
> >>>> On RHEL 5.2, if I use SetEnv in
> httpd.conf, I only
> >> see the
> >>>> variables
> >>>> in the "Apache Environment"
> section and
> >> not the
> >>>> "Environment" section
> >>>> of phpinfo().
> >>>>
> >>>>> NOTHING about Oracle in php.ini but
> there is a
> >> section
> >>>> about MySQL
> >>>>
> >>>> That's fine. Nothing needs to be set.
>
> >> Everything has
> >>>> a default. You
> >>>> can see the defaults in phpinfo output,
> and they
> >> are mostly
> >>>> tuning
> >>>> settings. You can add any configuration
> setting
> >> you want
> >>>> to change.
> >>>> Nothing there will affect a basic
> connection test
> >> script
> >>>> like the one
> >>>> you previously posted.
> >>>>
> >>>>
> >>>> Chris
> >>>>
> >>>> -- Email: christopher.jones@oracle.com
> Tel: +1
> >> 650 506
> >>>> 8630
> >>>> Twitter: http://twitter.com/ghrd Free
> PHP
> >> Book:
> >>>> http://tinyurl.com/f8jad
> >>>
> >>>
> >>>
> >> --
> >> Email: christopher.jones@oracle.com Tel: +1 650
> 506 8630
> >> Twitter: http://twitter.com/ghrd Free PHP
> Book:
> >> http://tinyurl.com/f8jad
> >
> >
> >
> >
>
> --
> Email: christopher.jones@oracle.com Tel: +1 650 506 8630
> Twitter: http://twitter.com/ghrd Free PHP Book:
> http://tinyurl.com/f8jad
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php