After several days of beating myself in the head, I finally got my FreeTDS ODBC data source working from the Linux console:
[B]linux_server: isql -v tSpectrum dbuser dbpassword[/B]
+---------------------------------------+
| Connected! |
| |
+---------------------------------------+
SQL> use Forefront;
[01000][FreeTDS][SQL Server]Changed database context to 'Forefront'.
[ISQL]INFO: SQLExecute returned SQL_SUCCESS_WITH_INFO
SQL> select * from WO_ZONE_MC WHERE Zone = 1;
+-------------+-----+---------------------+-----------+-----------------+---------------------------------+
| Company_Code| Zone| Zone_Description | Color_Flag| Custom_Icon_Flag| Custom_Icon_Filename |
+-------------+-----+---------------------+-----------+-----------------+---------------------------------+
| ARC | 1 | CITY CENTER | | | |
| CCC | 1 | | | | |
| CON | 1 | | | | |
| ELE | 1 | | | | |
| HHC | 1 | | | | |
| XYZ | 1 | CALGARY | | | |
+-------------+-----+---------------------+-----------+-----------------+---------------------------------+
SQLRowCount returns 6
6 rows fetched
SQL> quit
[B]linux_server: /usr/bin/php -f /srv/www/portal/test1.php[/B]
Connected!
[B]linux_server:[/B]
However, if I run the same PHP script from my web server, it fails to connect. I can't seem to find any info on changing settings for Apache. Any ideas?
Here's the ODBC section of my phpinfo page:
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library unixODBC
ODBC_INCLUDE -I/usr/include
ODBC_LFLAGS -L/usr/lib64
ODBC_LIBS -lodbc
Directive Local Value Master Value
odbc.allow_persistent Off Off
odbc.check_persistent On On
odbc.default_cursortype Static cursor Static cursor
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited