[freetds] freeTDS 0.62.4 / PHP 4.3.8 / AIX 4.3.3
joffrey.pannequin at laposte.net
Fri Feb 4 20:38:55 EST 2005
Thanks for your answers. And for the archives which helped me a lot.
At the end of the mail is the solution of the problem :
Joffrey Pannequin wrote:
> I have several problems making freetds and php works together under AIX.
> Has anyone successdully used this installation ?
> At first, the apps and pools did not link OK. So I had to use the idea
> of Fréderic le Guillou :
> Now I have freetds which compiles and links OK. I can test the
> connection to a SQL*Server DB with tsql.
> I made this PHP test script :
> $con = mssql_connect ("ip:port", "user", "****");
> mssql_select_db ("db_name", $con);
> $sql= "SELECT * FROM TABLE";
> $rs= mssql_query ($sql, $con);
> echo "<html><head>/Title/</head><body>The field number one is:";
> echo mssql_result ($rs, 0, 0);
> echo " </body></html>";
> mssql_close ($con);
> It works on the command line of php, but not from apache.
> Why ?
> Another problem : when I change the code of freetds, i can recompile and
> install in /usr/local/freetds the libraries, but it seems php does not
> use the libraries (I can delete them, php command line still works).
The explanation : freetds is linked inside the php lib and exec. So
after recompiling freetds, I had to relink php.
> My compilation directive :
> UnixODBC :
> ./configure --prefix=/usr/local/unixODBC --enable-gui=no
> Freetds :
> ./configure --prefix=/usr/local/freetds
> --with-unixodbc=/usr/local/unixODBC --with-tdsver=8.0 --enable-dbmfix
> PHP :
> ./configure --prefix=/usr/local/php
> --with-mssql=/usr/local/freetds --without-mysql
> Joffrey Pannequin
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> From - Fri
Still the same architecture : freeTDS 0.62.4 / PHP 4.3.8 / AIX 4.3.3 .
I have been trying to locate the line in the source code that causes
the problem, by debugging the program.
It appeared to me that it was due to a call to iconv_open.
This call works on the command line.
But not when called from the php module (libphp4.so) for Apache.
So I launched the configure with the following options :
./configure --prefix=/usr/local/freetds --disable-libiconv
--without-unixodbc --with-tdsver=8.0 --enable-dbmfix --disable-shared
--disable-libiconv is to use the iconv coded inside freetds instead of
the one from AIX or gcc or whatever (see
http://lists.ibiblio.org/pipermail/freetds/2004q1/015431.html and the
--disable-shared is to use static library instead of shared ones. It
means freetds will be inside php and not as a separate module (so
bigger). But it avoided me segmentation fault... I guess it is due to
the way AIX deals with shared libraries.
And now I can finally see my test page in my browser (well after the
make && make install && [configure,make,make install for php as well]).
Note : I have to disable odbc by hand (in the Makefile) or I missed
something (maybe --without-odbc).
More information about the FreeTDS