Using PHP to Query an Oracle Server

Martin McCormick martin at
Fri Mar 26 22:00:59 UTC 2004

	This is my second trip to the blinux list today and
my thanks to all for making it a good list.

	I have been trying off and on to use php under FreeBSD to send
queries to a SQL data base on a Pinnacle server.  Most people use php
in web development, but I am interested in using it to send sql
commands to an Oracle server running Oracle8I.

	The version of php is php4.3.4 and my problem is that I can
not seem to get php to understand that the SQL server is on a remote
system.  There is a configuration file called tnsnames.ora which
describes the server's IP address and host name.
I have put that file just about anywhere that remotely makes sense
plus a few places that really don't and the result is always the same.
php starts looking locally and, of course, finds nothing and then
gives up.

	The format of the command I am testing with right now is

$conn= ora_logon("username at servername" , "password");
	We do successfully query a Microsoft data base using PHP so I
know it works for that.

	If this story is familiar to anybody, please tell me what I am
probably not doing or doing wrong.

	Also, if there is  a good resource I can read, that would help
tremendously.  The documentation for PHP is a thousand times better
than earlier versions, but it is primarily geared toward people using
php in web servers.

	If there is another utility better suited to working remotely
with Oracle SQL, I would be happy to know about it.

	What we are doing is trying to get data from the Oracle
server, put it in to programs and scripts, and then send a completion
value back to the Oracle server.  So far, we are stuck fast.

	Even though this is a Linux list, many of the FreeBSD packages
work very similarly.

	Thanks for any good ideas.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group

More information about the Blinux-list mailing list