Forum Stats

  • 3,826,042 Users
  • 2,260,590 Discussions
  • 7,896,773 Comments

Discussions

Problem PHP Oracle - Instant Client

2668606
2668606 Member Posts: 1
edited May 7, 2014 10:00PM in PHP


Hi,

i have been trying to resolve this issue but im not really sure what i need to do, could someone help me?

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

Im getting this error when i try to connect to a Oracle database via PHP.

My host is Windows, Oracle instant client is on C:\instantclient_11_2 and added on PATH Variables.

I think there are missing some oracle variables on my phpinfo(), below:

OCI8 Support enabled
Version 1.4.9
Revision $Id: 44bfa713983a99b3e59477f6532e5fb51b6dee94 $
Active Persistent Connections 0
Active Connections 0
Oracle Run-time Client Library Version 0.0.0.0.0
Oracle Instant Client Version 11.2
Temporary Lob support enabled
Collections support enabled

 

DirectiveLocal ValueMaster Value
oci8.connection_classno valueno value
oci8.default_prefetch100100
oci8.eventsOffOff
oci8.max_persistent-1-1
oci8.old_oci_close_semanticsOffOff
oci8.persistent_timeout-1-1
oci8.ping_interval6060
oci8.privileged_connectOffOff
oci8.statement_cache_size2020

Environment

VariableValue
REDIRECT_HANDLER application/x-httpd-php
REDIRECT_STATUS 200
HTTP_HOST marcelb01v
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_CONNECTION keep-alive
PATH C:\instantclient_11_2;O:\ora11202w\BIN;C:\PHP\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;
SystemRoot C:\windows
COMSPEC C:\windows\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR C:\windows
SERVER_SIGNATURE no value
SERVER_SOFTWARE Apache/2.2.25 (Win32) mod_fcgid/2.3.6
SERVER_NAME marcelb01v
SERVER_ADDR 10.26.213.195
SERVER_PORT 80
REMOTE_ADDR 10.45.112.152
DOCUMENT_ROOT C:/htdocs
SERVER_ADMIN **
SCRIPT_FILENAME C:\htdocs\stuffs\test.php
REMOTE_PORT 51461
REDIRECT_URL /stuffs/test.php
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /stuffs/test.php
SCRIPT_NAME /stuffs/test.php
ORIG_SCRIPT_FILENAME C:/PHP/php-cgi.exe
ORIG_PATH_INFO /stuffs/teste.php
ORIG_PATH_TRANSLATED C:\htdocs\stuffs\test.php
ORIG_SCRIPT_NAME /php/php-cgi.exe

PHP Variables

VariableValue
_SERVER["REDIRECT_HANDLER"]application/x-httpd-php
_SERVER["REDIRECT_STATUS"]200
_SERVER["HTTP_HOST"]marcelb01v
_SERVER["HTTP_USER_AGENT"]Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0
_SERVER["HTTP_ACCEPT"]text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_LANGUAGE"]en-US,en;q=0.5
_SERVER["HTTP_ACCEPT_ENCODING"]gzip, deflate
_SERVER["HTTP_CONNECTION"]keep-alive
_SERVER["PATH"]C:\instantclient_11_2;O:\ora11202w\BIN;C:\PHP\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;
_SERVER["SystemRoot"]C:\windows
_SERVER["COMSPEC"]C:\windows\system32\cmd.exe
_SERVER["PATHEXT"].COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
_SERVER["WINDIR"]C:\windows
_SERVER["SERVER_SIGNATURE"]no value
_SERVER["SERVER_SOFTWARE"]Apache/2.2.25 (Win32) mod_fcgid/2.3.6
_SERVER["SERVER_NAME"]marcelb01v
_SERVER["SERVER_ADDR"]10.26.213.195
_SERVER["SERVER_PORT"]80
_SERVER["REMOTE_ADDR"]10.45.112.152
_SERVER["DOCUMENT_ROOT"]C:/htdocs
_SERVER["SERVER_ADMIN"]***
_SERVER["SCRIPT_FILENAME"]C:\htdocs\stuffs\test.php
_SERVER["REMOTE_PORT"]51461
_SERVER["REDIRECT_URL"]/stuffs/test.php
_SERVER["GATEWAY_INTERFACE"]CGI/1.1
_SERVER["SERVER_PROTOCOL"]HTTP/1.1
_SERVER["REQUEST_METHOD"]GET
_SERVER["QUERY_STRING"]no value
_SERVER["REQUEST_URI"]/stuffs/test.php
_SERVER["SCRIPT_NAME"]/stuffs/test.php
_SERVER["ORIG_SCRIPT_FILENAME"]C:/PHP/php-cgi.exe
_SERVER["ORIG_PATH_INFO"]/stuffs/test.php
_SERVER["ORIG_PATH_TRANSLATED"]C:\htdocs\stuffs\test.php
_SERVER["ORIG_SCRIPT_NAME"]/php/php-cgi.exe
_SERVER["PHP_SELF"]/stuffs/test.php
_SERVER["REQUEST_TIME"]1399483024
Tagged:

Answers

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,648 Employee

    Your PATH includes "C:\instantclient_11_2;O:\ora11202". This hints that you have multiple versions of Oracle installed, which is common cause of issues.

    Do you need Instant Client?  If you already have an Oracle DB you don't really need Instant Client unless you have a particular version requirement.

This discussion has been closed.