Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Jul 2009 16:57:30 -0500
From:      Martin McCormick <martin@dc.cis.okstate.edu>
To:        freebsd-questions@freebsd.org
Subject:   Oracle, php and a Fog of Confusion oci_connect
Message-ID:  <200907012157.n61LvUgn094165@dc.cis.okstate.edu>

next in thread | raw e-mail | index | archive | help
I have a fragment of php code which connects to an external
Oracle data base. It looks mostly like:

   <?php
   //open connection to database
   $conn = oci_connect("db_name", "PASS_WORD",
   "host.name.OKSTATE.EDU");
     if (!$conn) {
      $e = oci_error();
      print htmlentities($e['message']);
      exit;
     }
   ?>

	We have had php5 installed on the system in question for
a couple of years and just successfully installed
linux-oracle-instantclient-sqlplus.

	The info from php says it understands shared libraries.

	If I run the code fragment via php using a script
starting with
#! /usr/local/bin/php

I get
#
Fatal error: Call to undefined function oci_connect() in /usr/home/martin/tmp/qtest on line 4

I am not terribly surprised since, unless a shared library
changed, php is the same old php we have had all this time.

	Basically, I am confused as to what I need to do next to
weld the tail on the donkey.:-) Somehow, this all has to fit
together to produce the connection to the Oracle server.

	The linux-oracle-instantclient-sqlplus  pkg-descr file
says:

Oracle instant client - SQLPlus distribution

Instant Client allows you to run your applications without installing
the standard Oracle client or having an ORACLE_HOME.  OCI, OCCI, ODBC,
and JDBC applications work without modification, while using
significantly less disk space than before.  Even SQL*Plus can be used
with Instant Client.  No recompile, no hassle.

	Any suggestion? Obviously the php application hasn't
gotten wind of the instantclient yet.

Martin McCormick
Systems Engineer
405 744-7572   Stillwater, OK
Information Technology Department
Telecommunications Services Group



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907012157.n61LvUgn094165>