Page 1 of 1

Not Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005

PostPosted: 12. March 2012 18:17
by mrtuanvn
Please help me about: Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005.
My OS: Windows XP SP3, use dreamware program for code PHP,
I use webserver is XAMPP 1.7.7 (PHP 5.3.8 attached), went create php page, connect to database sql server express 2005 with content:
<?php
$kn=mssql_connect(".\SQLEXPRESS","abc","1234");
if(!$kn)
{
echo "Can't connect to database";
exit;
}
mssql_select_db("KN2",$kn);
?>
And press F12 (run) ==> "Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\xemdiem\knsv.php on line 4 "

==> help me solve this problem.
Thanks.

Re: Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005

PostPosted: 12. March 2012 18:51
by Altrea
One way to connect XAMPP 1.7.7 PHP with MSSQL Server is described here:
viewtopic.php?f=16&t=49670#p191618

best wishes,
Altrea

P.S.: Remember that php_sqlsrv uses a different syntax. You can find everything about it here:
http://www.php.net/manual/en/book.sqlsrv.php

Re: Not Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005

PostPosted: 12. March 2012 19:15
by mrtuanvn
i download 2 file : SQLSRV30.exe, I extracted that package into a folder on my desktop, and then
I copied "php_pdo_sqlsrv_53_ts_vc9.dll" and "php_sqlsrv_53_ts_vc9.dll" to my "/xampp/php/ext" folder
Added the extension lines to my "php.ini" file 2 row:
extension=php_sqlsrv_53_ts_vc9.dll
extension=php_pdo_sqlsrv_53_ts_vc9.dll
to php.ini,
but when I press start Apache on XAMPP contel panel ==>Dialog Warning: "PHP Starup: Unable to load dynamic library 'C:\xampp\php\ext\php_sqlsrv_53_ts_vc9.dll' - The specified module could not be found."
==> What is it ? solve this problem ????????
Help me..!

Re: Not Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005

PostPosted: 14. March 2012 04:07
by hackattack142
I did the steps again with the updated with the updated components and my Apache still started. Both PDO_sqlsrv and sqlsrv show up in my phpinfo()

1. I grabbed the Microsoft Drivers 3.0 for SQL Server for PHP from here: http://www.microsoft.com/download/en/de ... n&id=20098
2. I extracted that package into a folder on my desktop
3. I copied "php_pdo_sqlsrv_53_ts.dll" and "php_sqlsrv_53_ts.dll" to my "/xampp/php/ext" folder
4. Added the extension lines to my "php.ini" file
Code: Select all
extension=php_pdo_sqlsrv_53_ts.dll
extension=php_sqlsrv_53_ts.dll

5. Installed the Microsoft® SQL Server® 2012 Native Client on my machine (Stated as a requirement on the PHP manual page): (About 2/3 of the way down the page) http://www.microsoft.com/download/en/de ... x?id=29065
6. Started Apache via the Control Panel and it started up without crashing

Re: Not Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005

PostPosted: 12. April 2012 23:29
by marthom
Microsoft® SQL Server® 2012 Native Client installation interrupts on my W2k3 x86 Server. The 2008 Native Client runs.
But now i can only use SQLSRV2.0. 3.0 hangs...
(when I press start Apache on XAMPP contel panel ==>Dialog Warning: "PHP Starup: Unable to load dynamic library 'C:\xampp\php\ext\php_sqlsrv_53_ts_vc9.dll' - The specified module could not be found.")

I think...
2012 Native Client <=> SQLSRV 3.0
2008 Native Client <=> SQLSRV 2.0

Re: Not Connect PHP 5.3.8 (XAMPP 1.7.7) to Sql Sever 2005

PostPosted: 19. April 2012 22:27
by hackattack142
The hanging is probably an artifact of Microsoft dropping support for Windows XP and Windows Server 2003 in SQLSRV 3.0 and the 2012 Native Client. If you need it for one of those dropped systems then you will need to find download links for SQLSRV 2.0 and the 2008 Native Client.