hi,
i need to connect to a remote oracle database from a PHP script.
Do i need to install any drivers or packages to connect with the remote database?
when i use below code
<?php
if ($c = oci_connect("username", "passwd", "remote server IP")) {
echo "Successfully connected to Oracle.";
oci_close($c);
} else {
$err = oci_error();
echo "Oracle Connect Error " . $err['text'];
}
?>
it gives below error
"PHP Fatal error: Call to undefined function: oci_connect() "
I'm wondering whether i need to install any drivers
pls advice someone
thanks
Connect to remote oracle database from php script
Moderator: General Moderators
-
asela_05085
- Forum Newbie
- Posts: 16
- Joined: Mon Aug 31, 2009 10:33 pm
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Connect to remote oracle database from php script
You'll need the Oracle client or instant client running on the server that you're trying to connect from
-
asela_05085
- Forum Newbie
- Posts: 16
- Joined: Mon Aug 31, 2009 10:33 pm
Re: Connect to remote oracle database from php script
can you specify such clients 
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Connect to remote oracle database from php script
Specify? in what sense?asela_05085 wrote:can you specify such clients
-
asela_05085
- Forum Newbie
- Posts: 16
- Joined: Mon Aug 31, 2009 10:33 pm
Re: Connect to remote oracle database from php script
since I'm totally new i don't know much about this
do you mean to install a client in the server(my server is a linux machine with PHP 4.3)
if so what are those client that serve my need?
do you mean to install a client in the server(my server is a linux machine with PHP 4.3)
if so what are those client that serve my need?
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Connect to remote oracle database from php script
You would need to install either the Oracle Client or the Oracle Instant Client for Linux. If your Oracle database is instaklled on a Linux database, then this should be available on the CD that the database server was installed from. If not, or if your database server is running 64-bit Linux and your web server is 32-bit Linux, then you'll need to locate a copy of the appropriate version of Oracle, as a download from metalink or from your database support team.asela_05085 wrote:since I'm totally new i don't know much about this
do you mean to install a client in the server(my server is a linux machine with PHP 4.3)
if so what are those client that serve my need?
I'd also recommend upgrading the version of PHP that you're running as well. 4.3 is very old now