Hi, this is my problem :
Cannot execute command to Unidata via PHp/ODBC
Here's my configure command for PHP: PHP Version 4.0.4pl1
--------------------------------------------------------------------------------------------
./configure --with-apxs=/usr/local/apache/bin/apxs --with-pgsql --enable-sysvsem --enable-sysvshm --enable-sigchild
--with-mcrypt --with-mhash --libdir=/usr/local/lib --with-java --with-iodbc=/usr/local/openlink/odbcsdk --with-openlink
And it works fine with my Apache 1.3.19
This is my /usrlocal/openlink/bin/odbc.ini
--------------------------------------------------------------
[root bin]# cat /usr/local/openlink/bin/odbc.ini
;[ODBC]
;DebugFile=/usr/local/openlink/log/opltrace.log
;
; odbc.ini
;
[ODBC Data Sources]
testuni = Informix/Unidata
[testuni]
DRIVER = /home/src/iodbc/lib/oplodbc.so.1
Description = Unidata DB
FetchBufferSize = 60
ServerOptions = localud
Host = localud
Port = 5000
Password = test
Database = testuni
UserName = dbuser
Protocol = TCP/IP
ServerType = Odbc
ReadOnly = No
NoLoginBox = No
DeferLongFetch = No
[Default]
Driver = /usr/local/openlink/odbcsdk/lib/oplodbc.so.1
[ODBC]
[root bin]# cat /usr/local/openlink/bin/odbc.ini
;[ODBC]
;DebugFile=/usr/local/openlink/log/opltrace.log
;
; odbc.ini
;
[ODBC Data Sources]
testuni = Informix/Unidata
[testuni]
DRIVER = /home/src/iodbc/lib/oplodbc.so.1
Description = Unidata DB
FetchBufferSize = 60
ServerOptions = localud
Host = localud
Port = 5000
Password = test
Database = testuni
UserName = dbuser
Protocol = TCP/IP
ServerType = Odbc
ReadOnly = No
NoLoginBox = No
DeferLongFetch = No
[Default]
Driver = /usr/local/openlink/odbcsdk/lib/oplodbc.so.1
; If I put on the top, error given
[ODBC]
;DebugFile=/usr/local/openlink/log/terminal.log
DebugFile=/usr/local/openlink/log/php.log
[root bin]#
My test2.php code
---------------------------
<?
putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");
putenv("ODBCINSTINI=/usr/local/openlink/odbcsdk/doc/dbcinst.ini"); //this location will be determined by your driver install.
putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini"); //odbc.ini contains your DSNs, location determined by your driver instal$
$cx=odbc_connect("testuni","dbuser","test",SQL_CUR_USE_ODBC );
echo $cx;
$stmt = odbc_prepare($cx,"SELECT NAME FROM CUSTOMER");
$exec = odbc_execute($stmt);
//$cur=odbc_exec($cx,"SELECT NAME FROM CUSTOMER");
//$tablelist = odbc_tables($cx);
//echo $tablelist;
?>
PHP error message :
---------------------------------
Resource id #1
Warning: SQL error: [OpenLink][ODBC][Ardent][SQL Client][UNIDATA]You have no privilege on file SQLTables, SQL state S1000 in SQLPrepare in
/usr/local/apache/htdocs/test2.php on line 12
Warning: Supplied argument is not a valid ODBC result resource in /usr/local/apache/htdocs/test2.php on line 13
oplrqb log file in Win2000
-------------------------------------
blank log
I've started the services with these parameter : +loglevel 7 +logfile trace.log
And opened up test2.php on linux server, but no log is written
Error log on Apache
------------------------------
[root bin]# tail -f /usr/local/apache/logs/error_log
OpenLink: RPC: Timed out
OpenLink: RPC: Timed out
OpenLink: RPC: Timed out
OpenLink: [Ardent][SQL Client]Remote user id is required.
OpenLink: [Ardent][SQL Client]Remote user id is required.
If I changed the user id into false one..it will gives error, means PHP can connect to openlink.
I wonder why openlink won't write the log file via PHP ?
Cannot execute command to Unidata via PHp/ODBC
Here's my configure command for PHP: PHP Version 4.0.4pl1
--------------------------------------------------------------------------------------------
./configure --with-apxs=/usr/local/apache/bin/apxs --with-pgsql --enable-sysvsem --enable-sysvshm --enable-sigchild
--with-mcrypt --with-mhash --libdir=/usr/local/lib --with-java --with-iodbc=/usr/local/openlink/odbcsdk --with-openlink
And it works fine with my Apache 1.3.19
This is my /usrlocal/openlink/bin/odbc.ini
--------------------------------------------------------------
[root bin]# cat /usr/local/openlink/bin/odbc.ini
;[ODBC]
;DebugFile=/usr/local/openlink/log/opltrace.log
;
; odbc.ini
;
[ODBC Data Sources]
testuni = Informix/Unidata
[testuni]
DRIVER = /home/src/iodbc/lib/oplodbc.so.1
Description = Unidata DB
FetchBufferSize = 60
ServerOptions = localud
Host = localud
Port = 5000
Password = test
Database = testuni
UserName = dbuser
Protocol = TCP/IP
ServerType = Odbc
ReadOnly = No
NoLoginBox = No
DeferLongFetch = No
[Default]
Driver = /usr/local/openlink/odbcsdk/lib/oplodbc.so.1
[ODBC]
[root bin]# cat /usr/local/openlink/bin/odbc.ini
;[ODBC]
;DebugFile=/usr/local/openlink/log/opltrace.log
;
; odbc.ini
;
[ODBC Data Sources]
testuni = Informix/Unidata
[testuni]
DRIVER = /home/src/iodbc/lib/oplodbc.so.1
Description = Unidata DB
FetchBufferSize = 60
ServerOptions = localud
Host = localud
Port = 5000
Password = test
Database = testuni
UserName = dbuser
Protocol = TCP/IP
ServerType = Odbc
ReadOnly = No
NoLoginBox = No
DeferLongFetch = No
[Default]
Driver = /usr/local/openlink/odbcsdk/lib/oplodbc.so.1
; If I put on the top, error given
[ODBC]
;DebugFile=/usr/local/openlink/log/terminal.log
DebugFile=/usr/local/openlink/log/php.log
[root bin]#
My test2.php code
---------------------------
<?
putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");
putenv("ODBCINSTINI=/usr/local/openlink/odbcsdk/doc/dbcinst.ini"); //this location will be determined by your driver install.
putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini"); //odbc.ini contains your DSNs, location determined by your driver instal$
$cx=odbc_connect("testuni","dbuser","test",SQL_CUR_USE_ODBC );
echo $cx;
$stmt = odbc_prepare($cx,"SELECT NAME FROM CUSTOMER");
$exec = odbc_execute($stmt);
//$cur=odbc_exec($cx,"SELECT NAME FROM CUSTOMER");
//$tablelist = odbc_tables($cx);
//echo $tablelist;
?>
PHP error message :
---------------------------------
Resource id #1
Warning: SQL error: [OpenLink][ODBC][Ardent][SQL Client][UNIDATA]You have no privilege on file SQLTables, SQL state S1000 in SQLPrepare in
/usr/local/apache/htdocs/test2.php on line 12
Warning: Supplied argument is not a valid ODBC result resource in /usr/local/apache/htdocs/test2.php on line 13
oplrqb log file in Win2000
-------------------------------------
blank log
I've started the services with these parameter : +loglevel 7 +logfile trace.log
And opened up test2.php on linux server, but no log is written
Error log on Apache
------------------------------
[root bin]# tail -f /usr/local/apache/logs/error_log
OpenLink: RPC: Timed out
OpenLink: RPC: Timed out
OpenLink: RPC: Timed out
OpenLink: [Ardent][SQL Client]Remote user id is required.
OpenLink: [Ardent][SQL Client]Remote user id is required.
If I changed the user id into false one..it will gives error, means PHP can connect to openlink.
I wonder why openlink won't write the log file via PHP ?