note 13616 deleted from function.mssql-connect by didou

From: Date: Sun, 04 Feb 2007 05:53:15 +0000
Subject: note 13616 deleted from function.mssql-connect by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-122789@lists.php.net to get a copy of this message
Note Submitter: mazdak at actfit dot com ---- Procedure for M$SQL Support in PHP 4.0.5+/*NIX ============================================== What We Need ? ============== * PHP Source (latest) * FreeTDS (http://www.freetds.org/) get latest stable version * Patience!!! * Dual Login Mode in SQL Server Enterprise Manager (Windows ONLY login will not work!) Installation Procedure ! ======================== (1) > tar -xzvf freetds-xxx.tgz > cd freetds-xxx/ > ./configure --prefix=/usr/local/ftds --with-tdsver=4.2 --enable-dbmfix > make && make install (2) > Edit your /etc/ld.so.conf (or equivalant) add /usr/local/ftds/lib to it > run ldconfig (located in /sbin/ldconfig in linux) (3) GET READY TO HACK!!! > tar -xzvf php-xxx.tar.gz > cd php-xxx/ > edit 'ext/sybase/config.m4', replace 'dbopen' with 'tdsdbopen' (in version 4.0.6 of PHP this in on line 27 of config.m4) > (I am not sure if this step is 100% necessary, but do it anyway!) edit the 'configure' file and look for PHP_SYBASE_DBOPEN, you should see two different versions of this. As follows: #define PHP_SYBASE_DBOPEN tdsdbopen <-- leave this alone #define PHP_SYBASE_DBOPEN dbopen <-- change this to #define PHP_SYBASE_DBOPEN tdsdbopen (4) > ./configure [put other php options here] --with-mssql=/usr/local/ftds > --with-sybase=/usr/local/ftds > make && make install > cp php.ini-dist /usr/local/lib/php.ini (the location of this file may differ for your > installation) (5) > Now, edit /usr/local/lib/php.ini file, look for 'sybase.interface_file' directive > uncomment it and change the value to /usr/local/ftds/interfaces (location where you installed > freeTDS) (6) > Edit /usr/local/ftds/interfaces file, for MSSQL, you have to add an entry like the following*: mssqlconnection query tcp tds4.2 IPADDRESS_OF_SQL_SERVER 1433 * when writing PHP code, use the name "mssqlconnection" for hostname, so you would use something like: $conn = "mssqlconnection"; $username = "myuser"; $password = "mypass"; $dbc = mssql_connect ("$conn", "$username", "$password"); (7) > Do a check to see if everything is OK, by starting Apache.

« previous php.notes (#122789) next »