Installing ODBC on Linux



Preparation


Make sure your Apache server is working before going further. It also does not hurt to verify that your network and firewall ports are configured correctly by simply TELNET-ing to port 6110 on the Windows PC (or Virtual Machine) that is hosting your ODBC Router:

% telnet xxx.xxx.xxx.xxx 6110
Connected to xxx.xxx.xxx.xxx.
Escape character is '^]'.
press [Return]
Connection closed by foreign host. <-- everything is ok
%

Installation


Step 1: Install the iODBC.NET driver for standard (32-bit X86) LINUX

# rpm -ivh http://odbcrouter.com/m/linux-x86

Step 2: Rebuild PHP --with-ODBCRouter support
NOTE: This procedure is broke in PHP v5.2.8, use an earlier version --note that Apple does not support v5.2.8 yet. Also, a separate patch is available for PHP v4.x (please contact AugSoft Support, if you need it).

NOTE: If you are using a Linux distribution that comes with RPMs or DEBs for PHP (such as Mandriva), you can skip Step 1 by simply finding the distribution's SRPM for PHP, install it, edit the build script's configure statement to include the --with-ODBCRouter option, then rebuild the RPM using rpmbuild. A similar procedure applies for DPKG files. (However, you would probably not really want urpmi or emerge to drastically modify a commercial website, so it's always better to hand-build your PHP installation.)


Download PHP v5.2.6 from http://www.php.net/get/php-5.2.6.tar.bz2/from/a/mirror
Untar it to a directory, cd to that directory and:

# ./configure --with-apxs2=/usr/sbin/apxs --with-ODBCRouter

where /usr/sbin/apxs is the location of your Linux installation's APXS utility.
Note: You may want to enable other PHP features or change the default installation path from /usr/local, see ./configure --help for more options. The above procedure gives you total control of your PHP environment.
Next,

# make
# make test

NOTE: If you have a Linux distribution that has pre-packaged rpms or debs for PHP installed (such as Mandriva), you may want to remove them with a command like rpm -e <packagename> where <packagename> comes from the list output by the command rpm -qa | grep php).

# make install


Step 3: Set the address of your ODBC Router

# cp /etc/odbcrouter.conf.sample /etc/odbcrouter.conf
# pico /etc/odbcrouter.conf

Now just change the line with myodbcrouter.mycompany.com to instead contain the IP address or DNS name of the Windows box hosting your network's ODBC Router. If your company has multiple ODBC Routers, create separate copies of that line but replace the leading * with the name of a data source being served by that line's corresponding ODBC Router. The line with the * becomes your "default" ODBC Router and if it exists, it must be the last line in the file.

Next:
PHP and ODBC



© August Software, USA., 2009. All Rights Reserved.
Page was generated in 0.0584 seconds