Hi,
Im setting up PHP for use with a ODBC-to-access 'database' on an NT-'system'.
Running linux debian 2.2, php4.0.1.p2 and apache 1.3.12.
Openlink's odbctest program runs with DSN=ademo;
even as user nobody. (l3kozzzz.tar- what version can it be?)
Compiled with iodbc. This is visible in the ODBC Support section in
phpinfo() output.
However, this section holds some empty values:
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library iodbc
ODBC_INCLUDE
ODBC_LFLAGS
ODBC_LIBS
(3x a missing value)
Tried many ways to have these values set.
- followed the php-iodbc guide at http://www.iodbc.org/odbc-phpHOWTO.html
It was written for php3, did things change?
"
<?putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");
putenv("ODBCINSTINI=/usr/local/openlink/odbcinst.ini");
putenv("ODBCINI=/usr/local/openlink/odbc.ini");
$dsn="DSN=OracleLocal"; // this is a valid DSN set up in the above
odbc.ini file, tested in odbctest
$user="scott"; //default user for the demo Oracle database
$password="tiger"; //default password for demo Oracle database
$sql="SELECT * FROM EMP";
if ($conn_id=odbc_connect("$dsn","","")){ etc wtc
"
This guide used varible names different from those in phpinfo(), hmmmmm
2.
Set the values in php.ini, both in upper and lowercase. No result.
- Tried to set the values in my script:
<?
putenv("LD_LIBRARY_PATH=/usr/local/lib:/usr/local/odbcsdk/include");
putenv("ODBCINSTINI=/usr/local/php/odbcinst.ini");
putenv("ODBCINI=/usr/local/php/odbc.ini");
putenv("ODBC_INCLUDE=/usr/local/php/");
putenv("ODBC_LIBS=/usr/local/lib/");
$MYDSN="DSN=ademo;HOST=194.229.153.199;ServerType=Odbc";
$MYDSN2="DSN=ademo";
$c=odbc_connect("$MYDSN2","","");
and all other ways I could imagine.
they only result in:
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 SQLConnect in /www/htdocs/index.php on line 9
configured PHPO with:
'./configure' '--with-iodbc=/usr/local/' '--with-mysql'
'-enable-sysvsem' '--enable-sysvshm' '--enable-safe-mode'
'--enable-track-vars' '--enable-magic-quotes' '--enable-debugger'
'--enable-url-includes' '--enable-ftp' '--with-xpfdlib' '--enable-yp'
'--with-shared' '--with-apache=../apache_1.3.12'
'--with-config-path=/usr/local/etc/' '--with-exec-dir=/usr/local/php/'
'--with-pgsql=/usr/local/pgsql/include/' '--with-dom=/usr/lib/'
Has anyone gone this road before and taken this last obstacle?
Also, if anyone knows more about what is unified odbc, Im interested.
The name sounds OK but I found no
further resources or links. ...
Thanks to all who read this far!
Barry