Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top