Installing ODBC support for PHP on Macintosh & XServe


Note: AugSoft also supports Classic Mac OS (System 7, 8 and 9) using a different set of procedures than described here. If you are nursing an old app, please contact Support for assistance.

Preparation


Before you start, quickly modify Apache to run in normal 32-bit mode.
NOTE: The following simple procedure may need to be performed after Software Update... installs a new Mac OS X or Mac OS X Server release.
% sudo apachectl stop
% sudo mv /usr/sbin/httpd /usr/sbin/httpd.ub
% sudo lipo -thin i386 /usr/sbin/httpd.ub -output /usr/sbin/httpd.i386
% sudo ln -s /usr/sbin/httpd.i386 /usr/sbin/httpd
% sudo reboot

Make sure that PHP is working on your Apache server before going further. It does not hurt to also 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
%

Download AugSoft's odbcnet module for ODBC Router. Open a Support ticket for latest copy.

Installation


Step 1: Install 'odbcnet'

After downloading AugSoft's odbcnet module, check the MD5 sum:
$ md5 ~/Desktop/odbcnet
MD5 (~/Desktop/odbcnet) = 5540f9b66b1a593e3156130906e1417b
if the MD5sum is different than the above number, try re-downloading with FireFox

Next move 'odbcnet' into your operating system:
% sudo mkdir /Library/ODBC
mkdir: /Library/ODBC/: File exists <-- can be ignored
% sudo cp ~/Desktop/odbcnet /Library/ODBC
% sudo chmod 755 /Library/ODBC/odbcnet

Step 2: Create your ODBC DSN

Now launch ODBC Administrator from the Utilities folder. If your Mac doesn't have such a utility, Open a Support ticket for the solution; otherwise:

click the DRIVERS tab
click the LOCK icon and authenticate as your Mac's Administrator
click the ADD button
click Description field and enter: ODBC Router Network Driver
click Driver file field and enter: /Library/ODBC/odbcnet
click Define as filed and select System
click OK
Click SystemDSN tab
click ADD
choose ODBC Router Network Driver
click Data Source Name (DSN) field and enter the name of your DSN such as Northwind exactly as it appears in SystemDSN tab on the Windows box hosting your ODBC Router
click OK
click APPLY (it's broke but what the heck)
quit ODBC Administrator application

Step 3: Map the new DSN to one of your existing ODBC Router boxes (substitute your DSN for Northwind and your ODBC Router box's IP address or DNS name for xxx.xxx.xxx.xxx.), example:

% sudo pico /Library/Preferences/odbcnet.txt
Now add a line like this:
DSN=Northwind!I#xxx.xxx.xxx.xxx:6110@Internet$NOLOGON=Y;

Note that after the Data Source Name (Northwind in the above example), there is an exclamation point and a capital letter I followed by a pound-sign followed by the IP address of your ODBC Router followed by a colon followed by the port number (6110 in the above example) followed by an at-sign followed by the literal word Internet (with capital letter I) followed by a dollar sign followed by the word NOLOGON followed by equal-sign followed by capital letter Y followed by semi-colon. (Instead of specifying an IP address you may alternatively specify a DNS name such as odbcrouter.mycompany.com.) The NOLOGON option means "don't display a modal dialog on the console of the web server prompting for some username and password if we failed to specify them right and instead just return an error.

Then exit the editor and enter:
% sudo chown _www /Library/Preferences/odbcnet.txt
That's it!

Next:
PHP and ODBC



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