Help!! Error when php->so->myodbc->mysql.
Posted 22 March 2006 - 10:19 AM
I executed "php test.php" at command line. Then I got "segment fault" on tty.
I apply ODBC trace log. I found SQLConnect succeeded but SQLExecDirect was failed at the first "SELECT" statement.
I traced into unixODBC and found no return from myodbc's SQLEXECDIRECT. It seems dead in myodbc.
I had not traced into myodbc since no source code of myodbc. I installed myodbc with binary code.
Furthermore, I used "C binary: main()"->"C++ shared object(*.so)"->unixODBC->myodbc->mysql architecture to test.
Everything is OK. SQLExecDirect succeeded at every "SELECT" statement.
The "SELECT" statement is the same as php execution mode. I saw they are coincident in ODBC trace log.
The environment is:
Login linux with "root".
Connect ODBC with "DSN=testdb;UID=root;PWD=;". There is no password for "root" of mysql.
mysql Ver 11.18 Distrib 3.23.54, for redhat-linux-gnu (i386)
PHP 4.4.2 (cli) (built: Mar 19 2006 15:50:38)
Copyright © 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright © 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for i386-redhat-linux-gnu
Copyright © 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Report bugs to <email@example.com>.
Posted 25 March 2006 - 05:59 AM
When I use exec-file built from C source code to test, the charset is "latin1".
And when I use "php test.php" to test, the charset struct parameter is null pointer. SQLDriverConnect passed but SQLExecDirect failed.
When SQLDriverConnect, "mysql_real_connect" said:
| | | >get_charsets_dir
| | | | info: charsets dir='NONEXISTENT/charsets/'
I configed the php.ini and add "default-charset=latin1". But the failure is the same.
Who can tell me how to set the charset for php->odbc->mysql?
Posted 01 April 2006 - 09:26 AM
After tracing, I found two different test way caused different call of "mysql_init" and other mysql client api:
When I use "a.out" built from C source code (a.out->my.so->iodbc->myodbc->mysql) to test, it used "mysql-init" within the libmysqlclient.so.
When I use "php test.php" (php->my.so->iodbc->myodbc->mysql) to test, it used "mysql_init" within "php". "php" client contained a "mysql_init" from its "ext/mysql".
So strange. And I have not found how to deal with it.
Please help me.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users