adrianharabula / php-oci8

Official Docker PHP image with Oracle Instant Client and OCI8
https://hub.docker.com/r/adrianharabula/php7-with-oci8
28 stars 35 forks source link

Fatal error: ORA-12154: TNS:could not resolve the connect identifier specified in /var/www/html/public/index.php on line 7 #6

Open flik opened 5 years ago

flik commented 5 years ago

When I try to access oracle db from SQLDeveloper tool, It is working but when I trying to connect with provided php script. It is throwing error below.

Fatal error: ORA-12154: TNS:could not resolve the connect identifier specified in /var/www/html/public/index.php on line 7

<?php
//phpinfo(); exit;

$conn = oci_connect('system', 'oracle', 'oracledb/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
} else echo 'succesful';

exit;
adrianharabula commented 9 months ago

Hello @flik ! Is this still an issue for you? Have you checked https://docs.oracle.com/en/database/oracle/oracle-database/21/lacli/environment-variables-instant-client.html ?