0

I have a php file(conn.php) which has the following contents:

<?php

$conn = oci_connect('mdl_img_tst', 'mdl_tst_usr', 'draa.uofl.com');
if (!$conn) {
  $e = oci_error();
  trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}

?>

Running this from the command line it returns following two errors:

Failed loading /usr/lib/php/extensions/no-debug-non-zts-20090626/5.3/xdebug.so: dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/5.3/xdebug.so, 9): image not found

PHP Fatal error: Call to undefined function oci_connect() in /Users/crdc/Sites/conn.php on line 5

What could be the possible reason for that?

UPDATE: I added a line extension=oci8.so and now there is a different error. Now it seems like oci8 is installed correctly but it has some problem with connection string.

PHP Warning:  oci_connect(): ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA in /Users/crdc/Sites/conn.php on line 5
PHP Fatal error:  ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA in /Users/crdc/Sites/conn.php on line 8

Any idea on that?

Community
  • 1
  • 1
N. F.
  • 891
  • 3
  • 9
  • 33
  • Do you have the [OCI8](http://www.php.net/manual/en/oci8.installation.php) extension installed in PHP? – Bad Wolf Sep 30 '13 at 16:37
  • Yes, I did installed it. My OS is Mountain Lion 10.8.4. But I am not quite sure if this is properly installed. I followed all the steps to install oci8. The steps are following: 1)installed brew 2)installed autoconf using brew 3)no luck in installing oci8 cause it needs cc/gcc to be installed, which will be installed if cmd line tools for X-Code is installed. 4)installed cmd line tools via Xcode 5)Installed oci8. – N. F. Sep 30 '13 at 16:38
  • Also, where to look at to find if this is properly installed? And I actually installed oci8 using pecl. – N. F. Sep 30 '13 at 16:43

1 Answers1

0

I would recommend verifying that OCI8 has actually been loaded by PHP.

Run this script

<?php

phpinfo();

?>

And verify that OCI8 is shown as a loaded plugin.

Robert L
  • 24
  • 2