Executing Microsoft SQL Server Stored Procedure from PHP on Linux
Learn how to setup, install and configure Apache and PHP on a Linux box to execute MS SQL stored procedures. This extensive article takes you through an in-depth look on how to achieve your ideal environment.
Executing Microsoft SQL Server Stored Procedure from PHP on Linux - Modify the PHP Source Code (Page 6 of 9 )
We have now come to the critical part in this article. Change directory to php-4.3.3, and issue the following command:
We need to modify some source code before we proceed to compile and install PHP. The reason to do this is: mssql_bind(), mssql_execute(), and mssql_init() do not work with FreeTDS without modification. I have compiled the PHP mssql module source code under the Windows system (Windows 2000/XP). Using Microsoft Visual C++ 6.0 by linking to the MS SQL Server DB library NTWDBLIB.LIB, these 3 functions works just fine under Windows (real functions that connect to MS SQL Server are in NTWDBLIB.DLL, which is installed with Windows and resides in SYSTEM32 folder).
On Linux, when we use FreeTDS, libsybdb.so is equivalent to NTWDBLIB.DLL on Windows, and libsybdb.la is equivalent to NTWDBLIB.LIB.
I seem to have encountered a small bug in FreeTDS to emulate same RPC API functions as in NTWDBLIB.DLL (these functions are: dbrpcparam, dbrpcexec, dbsqlok; the buggy one here is dbrpcparam in FreeTDS).
From the php-4.3.3 folder, we go further down into the folder: ext/mssql, which holds PHP’s mssql module files. Issue the following: