Board index   FAQ   Search  
Register  Login
Board index php forum :: Database Other Database Engines

php Oracle 11g and OCI8

Do you have questions regarding other database enginges (not MySQL) -- ask here!

Moderators: macek, egami, gesf

php Oracle 11g and OCI8

Postby khalilonoura » Tue Aug 09, 2011 10:53 am

Hi All,


I am new to PHP and I am not an Oracle DBA either. I am a systems admin but I am trying to configure PHP with oc8i. These are the steeps I took to do it all.
- I compiled Apache 2.2.9 with the followings --enable-so--enable-cgi--enable-info--enable-rewrite--enable-speling--enable-usertrack--enable-deflate --enable-ssl--enable-mime-magic
-Compiled php 5.3.6 with the followings --with-apxs2=/usr/local/apache/bin/apxs --with-mysql --prefix=/usr/local/apache/php --with-config-file-path=/usr/local/apache/php --with-oci8=/u01/app/oracle/client/product/11.2

when I run test.php file within the browser it shows my Environment to be like this LD_LIBRARY_PATH /usr/local/apache/lib and when I try to run a script to enter data into an Oracle tabel using oci-function I ge teh following error message:
Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories in /usr/local/apache/htdocs/sails_completed.php on line 2

Warning: oci_connect() [function.oci-connect]: Error while trying to retrieve text for error ORA-01804 in /usr/local/apache/htdocs/sails_completed.php on line 2
Oracle Connect Error Usage:sails_completed.php

Any help will be great,
khalilonoura
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Aug 09, 2011 6:07 am

Re: php Oracle 11g and OCI8

Postby khalilonoura » Wed Aug 10, 2011 5:16 am

Problem is fixed. After I went back to history on Server I noticed a space in --with-oci8=/u01/app/oracle/client/product/11.2. PHP compiled with out taking Oracel_Home path. I removed PHP, recomplied it again. all worked after that.

Thanks,
khalilonoura
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Aug 09, 2011 6:07 am

OCI.php Functions

Postby Ravioracle » Mon Mar 05, 2012 10:48 am

Dear All,

Is there any PHP templates/Reusable components available for Oracle connection.

e.g

function db_connect()
function db_query($qstring)
function db_numrows($qhandle)
function db_fetch_array()

Call to Function:

function ValidateLogin ($curruser, $password) {

$l_ok = 0 ;
$qs = "SELECT Test_ValidateLogin('$curruser','$password') l_ok FROM dual" ;
$q = db_query1 ($qs) ;
$rs = db_fetch_array($q) ;
$l_ok = $rs['l_ok'];

return $l_ok ;


Please advise.

Thanks,
Ravi
Ravioracle
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Mar 05, 2012 10:37 am

Re: php Oracle 11g and OCI8

Postby Ravioracle » Mon Mar 05, 2012 10:53 am

PHP 5.3.10
Apache 2.2.22
OCI 1.4.7

Please help me in designing resuable functions e.g oci.php or is there any code generator available?

e.g

function db_connect()
function db_fetch_array()
function db_query

Calls:

function ValidateLogin ($curruser, $password) {

$l_ok = 0 ;
$qs = "SELECT TEST_Validate_Login('$curruser','$password') l_ok FROM dual" ;
$q = db_query1 ($qs) ;
$rs = db_fetch_array($q) ;
$l_ok = $rs['l_ok'];

return $l_ok ;

Thanks,
Ravi
Ravioracle
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Mar 05, 2012 10:37 am

Re: php Oracle 11g and OCI8

Postby kandy » Fri Mar 09, 2012 10:19 pm

I removed PHP, recomplied it again. all worked after that.
kandy
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Mar 09, 2012 10:09 pm


Return to Other Database Engines

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.