How to connect with PHP and ezSQL in a MSSQL Server?


I have a .php file running in Apache on Linux... ok

Using ezSQL i need to connect in another server, a MSSQL Server running on Windows...

but i got the following error...

"Fatal Error: ezSQL_mssql requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable MS-SQL extenstion in PHP.ini file"

Ok, what is the problem, local? (in my client machine) or server (apache on linux)?

How can i do that? any idea?


require "/var/lib/ezsql/mssql.php";

$reg = $db->get_results("SELECT * FROM table");
echo print_r($reg);

Open in new window

Who is Participating?
HainKurtSr. System AnalystCommented:
Dave BaldwinFixer of ProblemsCommented:
If you are trying to connect to SQL Server 2005 or 2008 from Linux, the only known methods at the moment are some ODBC connectors but they are not free.  UnixODBC and FreeTDS might work for SQL Server 2000 but Microsoft changed the connection methods for 2005/2008.

'ntwdblib.dll' can be downloaded from several places and will help with 'mssql' on PHP 5.2 or less.  PHP 5.3 does not support that driver at all.  If you are on Windows, you can use the new Microsoft PHP SQL driver.  Make sure you also get the SQL Native Client.  This page has a lot of info:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.