Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have problem with connect ApacheHttpServer with Oracle. All work on OpenSuse 12.3

At first I install Oracle instal client 11.2. Set environment variables:


After that I compile apache http :

./configure --prefix=/usr/local/apache2/apr
make install

./configure --prefix=/usr/local/apache2/apr-util --with-apr=/usr/local/apache2/apr/
make install

CPPFLAGS=-IORACLE_HOME/include LDFLAGS=-LORACLE_HOME ./configure --prefix=/usr/local/apache2/httpd --with-apr=/usr/local/apache2/apr/ --with-apr-util=/usr/local/apache2/apr-util/
make install 

Unfortunately, the installation was not successful because didn't created. I think I was connected with that:

#./configure output:

checking oci.h usability... yes
checking oci.h presence... yes
checking for oci.h... yes
checking for OCIEnvCreate in -lclntsh... no
   setting LIBS to "-lnnz11"
checking for OCIEnvCreate in -lclntsh... no
   nulling LIBS
   setting LIBS to "-lnnz10"

I could not find a way how to solve. So I decided to use Oracle with ODBC driver. I install unixODBC 2.2.12-219.1.1.

After that I modife to odbc.ini and odbcinst.ini:

DRIVER = oraclevb
DSN = xe
ServerName = //
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
CloseCursor = F
DisableDPM = F
DisableMTS = T
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10`enter code here`
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MaxLargeData = 0
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T

Description = Oracle ODBC
Driver = /usr/local/instantclient_11_2/
Setup =
FileUsage =
CPTimeout =
CPReuse =

I chcek how it work with command:

isql -v xe user passowrd

All was OK. So I again compile Apache Http Source. Modify httpd.conf to use ODBC:

LoadModule authn_dbd_module modules/
LoadModule authn_core_module modules/
LoadModule authz_host_module modules/
LoadModule authz_user_module modules/
LoadModule authz_dbd_module modules/
LoadModule authz_core_module modules/

LoadModule access_compat_module modules/
LoadModule auth_basic_module modules/
LoadModule dbd_module modules/

DBDriver odbc
DBDParams "datasource=xe"

<Directory "/sample">
     AuthType Basic 
     AuthName "private area" 
     AuthBasicProvider dbd
     AuthDBDUserPWQuery "SELECT password FROM USERS WHERE name = %s"
     AuthzDBDQuery "SELECT group FROM GROUPS user_name = %s"
     Require dbd-group grup1 grup2

Start Apache HTTTP Server and I found in error logs:

[Sun Jul 14 15:19:07 2013] [dbd_odbc] SQLConnect returned SQL_ERROR (-1) at dbd/apr_dbd_odbc.c:1130 [unixODBC][Driver Manager]Can't open lib '/usr/local/instantclient_11_2/' : file not found 01000 
[Sun Jul 14 15:19:07.332394 2013] [dbd:error] [pid 13374:tid 140250220050240] (20014)Internal error: AH00629: Can't connect to odbc: [dbd_odbc] SQLConnect returned SQL_ERROR (-1) at dbd/apr_dbd_odbc.c:1130 [unixODBC][Driver Manager]Can't open lib '/usr/local/instantclient_11_2/' : file not found 01000 

I don't know what I can do with that. Any suggestions would be very helpful. Maybe there is another way that conduct authorization and authentication using the Oracle database. Or other Apache module?

share|improve this question

migrated from Jul 16 '13 at 9:13

This question came from our site for professional and enthusiast programmers.

If your make didn't create an .so file, didn't it stop at that point and print an error message about why it couldn't do that work? If so, please update your question to include the text of the error message. If what you quote above ..checking for OCIEnvCreate in -lclntsh... no... is the last message in the build, please indicate that. Good luck – shellter Jul 14 '13 at 17:11
when I do make, the command completed with succees (no error) bur .so for oracle didn't created. I think that is problem with checking for OCIEnvCreate in -lclntsh... no – ostry Jul 14 '13 at 20:32
If you're make process didn't stop at checking for OCIEnvCreate in -lclntsh... no, but continued on and did other work, then that is not the source of your problem. make files can be smart and try to use libraries from different directories What you see in the 'trace' is the make file looking for where OCIEnvCreate is installed. It goes with its best guess. If the .so wasn't found in a later part of a compile process, then the make would stop then. Your apache log error is a hint to me that not everything about your oracle installation is as it should be. – shellter Jul 14 '13 at 20:42
go to the root directory where oracle is installed (something like /opt/ora and the issue the cmd find . -name 'libsqora*'. If you get a result from this search, add that to your question above. Unless you're working on a small development machine, don't do find / -name..., as it will run for hours, searching all files available , even remote files that are mounted to your server. (Or do that as a last resort, just before you go to bed ;-) ). Good luck. – shellter Jul 14 '13 at 20:44
The result of find cmd is : ./ But I found other problem. After connect to oracle with isql -v xe user passowrd I try to execute sql statement, eg. SELECT * FROM USERS; As result isql give me : "SQLRowCount returns -1 19 rows fetched" – ostry Jul 14 '13 at 21:54

I would try to go with Oracle without ODBC. ODBC adds one more layer and both Oracle and ODBC usually are not as well tested as MySQL or PostgreSQL. Like others noticed the problem is with checking for OCIEnvCreate in -lclntsh... no. The most probably configure cannot find required libraries. You should try two things:
1. Check config.log for error messages about OCIEnvCreate.
2. Shouldn't httpd's configure command line say LDFLAGS=-L$ORACLE_HOME/lib? Of course I install instant client from RPMs but is in lib/ subdirectory.

share|improve this answer
Thank you for your response. I decided to use apache2 from OpenSuse 12.3 package and develop my own apache module which connects to Oracle and do what I want. – ostry Jul 23 '13 at 9:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.