Okay, I uninstalled unixODBC and tried iODBC ( I actually began to try it
before, but then thought of something that might work on unixODBC, so I went
back to it ).

Now iODBC's odbctest application works with myODBC installed. However, after
I recompile PHP with iodbc parameters, I try to run the odbc_connect
function. If I misspell the DSN or use a non-existent one, I will get the
following message:

Warning: SQL error: [iODBC][Driver Manager]Data source name not found and no
default driver specified. Driver could not be loaded, SQL state IM002 in

Now, if I spell the defined DSN correctly and reload the page, the
application just hangs. If I look at my error logs I see this:

/usr/libexec/ld-elf.so.1: /usr/local/lib/libmyodbc.so: Undefined symbol

Once for every time I reload the page. This is odd, because this was a
problem message I was receiving when testing unixODBC on the command line.
After I installed iODBC, the command-line application was able to connect
and query perfectly! So what gives? Why does one application work and
another does not?

I set the following environment vars - some may not make sense, but I've
been trying everything:

$EnvVars["LD_LIBRARY_PATH"] = "/usr/local/lib:/usr/include";
$EnvVars["LD_RUN_PATH"] = "/usr/local/lib:/usr/include";
$EnvVars["ODBCINI"] = "/usr/local/src/odbcsdk/doc/odbc.ini";
$EnvVars["PATH"] =

foreach($EnvVars as $Key => $Val)
 $HTTP_ENV_VARS["$Key"] = $Val;

I can see via phpinfo() that they are getting set. Any more ideas?

- Jonathan

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
> I'm on a FreeBSD 4.2 box running Apache 1.3.14+OpenSSL with mod_php4
> (4.0.3). I am attempting to set up ODBC for this box, and it's giving me
> problems.
> First, I installed unixODBC (www.unixodbc.org), which went fairly smooth.
> Second, I installed myODBC for UNIX via the ports directory, which also
> seemed to install fine.
> Third, I modified the mod_php4 Makefile to include --with-unixODBC and
> compiled it. Everything seemed to go through fine, and Apache restarted at
> the end.
> When I went to test the function, I got a "Page Cannot be Displayed" error
> (IE 5.5). If I try removing the line that uses odbc_connect(...), it will
> print out the request variables. Only when odbc_connect is present in the
> code, will it break.
> $conn_id=odbc_connect();
> I have tried this with a DSN name and a username and password, but it does
> not work. Any ideas, anyone?
> - Jonathan

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to