LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Install help for connecting to oracle database

Reply
 
Thread Tools Display Modes
  #11  
Old 02-07-2007, 09:02 AM
reshu1596 reshu1596 is offline
Member
 
Join Date: Feb 2007
Posts: 22
Quote:
Originally Posted by mistwang View Post
Try adding LD_LIBRARY_PATH to the "environment" section of the lsphp external application.

I am sorry, not sure I understand what that means. Is this a particular file or something I need to add before compiling?

Thanks
RM
Reply With Quote
  #12  
Old 02-07-2007, 09:37 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You need to change "lsphp" configuration under "external app" tab from the web admin interface.
just add "LD_LIBRARY_PATH=...." to "environment" configuration entry, this environment varible must be set explicitly from there.
Reply With Quote
  #13  
Old 02-07-2007, 10:23 AM
reshu1596 reshu1596 is offline
Member
 
Join Date: Feb 2007
Posts: 22
Quote:
Originally Posted by mistwang View Post
You need to change "lsphp" configuration under "external app" tab from the web admin interface.
just add "LD_LIBRARY_PATH=...." to "environment" configuration entry, this environment varible must be set explicitly from there.
Now I get the following error in stderr.log when I try to run a simple oracle connect. Looks like it still has some problems with LD_LIBRARY_PATH

2007-02-07 13:17:43.536 [NOTICE] [199.11.4.59:6443-0#Example] [STDERR] PHP Warning: ocilogon() [<a href='function.ocilogon'>function.ocilogon</a>]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in /export/home/rawlog/lsws/DEFAULT/html/ravioraconnect.php on line 3
2007-02-07 13:17:43.537 [NOTICE] [199.11.4.59:6443-0#Example] [STDERR] PHP Warning: ociparse() expects parameter 1 to be resource, boolean given in /export/home/rawlog/lsws/DEFAULT/html/ravioraconnect.php on line 7
2007-02-07 13:17:43.537 [NOTICE] [199.11.4.59:6443-0#Example] [STDERR] PHP Warning: ociexecute() expects parameter 1 to be resource, null given in /export/home/rawlog/lsws/DEFAULT/html/ravioraconnect.php on line 8
2007-02-07 13:17:43.537 [NOTICE] [199.11.4.59:6443-0#Example] [STDERR] PHP Warning: ocifetchinto() expects parameter 1 to be resource, null given in /export/home/rawlog/lsws/DEFAULT/html/ravioraconnect.php on line 9
2007-02-07 13:17:43.537 [NOTICE] [199.11.4.59:6443-0#Example] [STDERR] PHP Warning: ocilogoff() expects parameter 1 to be resource, boolean given in /export/home/rawlog/lsws/DEFAULT/html/ravioraconnect.php on line 16

Any ideas?
Thanks
RM

The following

<?php

$conn = OCILogon('usera', 'sql', '//oracletest:1521/Vitalnet');

$query = 'select table_name from user_tables';

$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}

OCILogoff($conn);

?>
Reply With Quote
  #14  
Old 02-07-2007, 11:01 AM
reshu1596 reshu1596 is offline
Member
 
Join Date: Feb 2007
Posts: 22
finally got it to work!!! I had to use the following two lines in the php script.
PutEnv("LD_LIBRARY_PATH=/export/home/rawlog/oracle/instantclient_10_2");
PutEnv("ORACLE_HOME=/oracle/g01/software/rdbms/9.2.0.6");

Any ideas why the lsphp doesn't use these environment variables?

I will send post another message with what all I did to get this working.

Thanks
Ravi
Reply With Quote
  #15  
Old 02-07-2007, 11:47 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
I think you need to add "ORACLE_HOME" env to "Environment" configuration of lsphp as well. No need to use PutEnv().

LSWS has strict security policy, when LSWS start a external application, it will not set any environment variables in your current system environment, you have set them explicitly in the configuration.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:30 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.