Re: oci_connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <christopher.jones@xxxxxxxxxx> wrote:

> From: Christopher Jones <christopher.jones@xxxxxxxxxx>
> Subject: Re:  oci_connect
> To: fredsilsbee@xxxxxxxxx
> 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 	<address>Apache/2.2.9 (Fedora)
> Server at localhost Port 8080</address>
> > 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
> <christopher.jones@xxxxxxxxxx> wrote:
> > 
> >> From: Christopher Jones
> <christopher.jones@xxxxxxxxxx>
> >> Subject: Re:  oci_connect
> >> To: fredsilsbee@xxxxxxxxx
> >> 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
> >> <christopher.jones@xxxxxxxxxx> wrote:
> >>>> From: Christopher Jones
> >> <christopher.jones@xxxxxxxxxx>
> >>>> Subject: Re:  oci_connect
> >>>> To: fredsilsbee@xxxxxxxxx
> >>>> Cc: php-db@xxxxxxxxxxxxx
> >>>> 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@xxxxxxxxxx 
> Tel: +1
> >> 650 506
> >>>> 8630
> >>>> Twitter:  http://twitter.com/ghrd    Free
> PHP
> >> Book:
> >>>> http://tinyurl.com/f8jad
> >>>
> >>>       
> >>>
> >> -- 
> >> Email: christopher.jones@xxxxxxxxxx  Tel: +1 650
> 506 8630
> >> Twitter:  http://twitter.com/ghrd    Free PHP
> Book:
> >> http://tinyurl.com/f8jad
> > 
> > 
> >       
> > 
> 
> -- 
> Email: christopher.jones@xxxxxxxxxx  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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux