1

I'm getting PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. when i'm trying to execute php.exe "c:\xampp\htdocs\test.php" from command line....

But if i browse it by (localhost/test || ip/test) browser it works....

Same code and instandclint (INSTANTCLIENT_11_2) version on another same machine works... i'm sure i'm doing something wrong.

basically i want to run a php file from command prompt (schedule run) which will do something and upload the data to oracle server. manually it is working but not from scheduling...

Any help would be great thanks in advance. (right now i'm running that schedule from my demo PC, which working to upload data to LIVE pc where it is not) weird!!!

thanks

Farness

              **oci8**
     OCI8 Support   enabled
     Version    1.4.5
     Revision   $Revision: 305257 $
     Active Persistent Connections  0
     Active Connections     0
     Oracle Instant Client Version  11.1
     Temporary Lob support  enabled
     Collections support    enabled 

test file

     <?php
         $i=0;
     //    include('OraCon.php');
        $c = oci_connect('user', 'pass','localhost/BDDBERP.LOCALHOST');
         $s = oci_parse($c, "select DEST, DESTCODE from DESTCOUNTRY ORDER BY DEST");
         oci_execute($s);
         while (($row = oci_fetch_array($s, OCI_BOTH))) {
             echo $row['DEST']   . ", ".$row['DESTCODE'].";";
             $i++;
         }


         oci_free_statement($s);
         oci_close($c);
     ?>
farness
  • 369
  • 2
  • 11
  • possible duplicate of [OCIEnvNlsCreate() failed. When i try to connect my oracle database in php](http://stackoverflow.com/questions/9734100/ocienvnlscreate-failed-when-i-try-to-connect-my-oracle-database-in-php) – Charles Dec 17 '12 at 18:19
  • Thank you charles... i'm not sure if it is duplicate because... on there it was failing in general like browser or anywhere. But in my case on browser (any browser) it is ok. but not from command prompt. but anyway i'v tried that put_env() but still no luck.... thanks again – farness Dec 18 '12 at 05:26

0 Answers0