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

Problems with the Windows version of XAMPP, questions, comments, and anything related.

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

Postby mrtuanvn » 12. March 2012 18:17

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.
Last edited by mrtuanvn on 12. March 2012 18:51, edited 1 time in total.
mrtuanvn
 
Posts: 2
Joined: 12. March 2012 18:03
Operating System: XP SP2

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

Postby Altrea » 12. March 2012 18:51

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
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

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

Postby mrtuanvn » 12. March 2012 19:15

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..!
mrtuanvn
 
Posts: 2
Joined: 12. March 2012 18:03
Operating System: XP SP2

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

Postby hackattack142 » 14. March 2012 04:07

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
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

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

Postby marthom » 12. April 2012 23:29

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
marthom
 
Posts: 4
Joined: 12. April 2012 23:22
Operating System: Windows Server 2003 x86

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

Postby hackattack142 » 19. April 2012 22:27

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.
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 137 guests