$db = "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521)))
(CONNECT_DATA =(SERVER = DEDICATED)(SID = orcl)))";
$conn = oci_connect('ssp', 'ssp', $db);
$s = oci_parse($conn, 'select * from CLIACCT ');
oci_execute($s);
while (($row = oci_fetch_array($s, OCI_ASSOC)) != false ) {
foreach ($row as $item) {
print $item;
}
}
Mình connect tới csdl Oracle từ máy khác trong cùng LAN 192.168.1.2.
Với đoạn code trên bỏ sang máy cài XAMP apache thì chạy OK, nhưng khi bỏ qua IIS & PHP thì lỗi như sau:
Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed.
There is something wrong with your system -
please check that PATH includes the directory with Oracle Instant Client libraries
in C:\Inetpub\wwwroot\oracle\test_2.php on line 111
mặc dù đã mở extension php_oci8.dll
Bác nào biết lỗi nào xin chỉ giúp ? cảm ơn các bác nhiều