ankit.pandeyc012 Posted November 8, 2011 Share Posted November 8, 2011 Hi friends... I am using Wamp with PHP 5.3 and want to connect with SQL Server 2005 but not successful. I also tried it with PHP 5.2.8 but it still not working. I google it and found some solutions but not successsful yet. Can anyone give me detailed guide (step by step) that how i can connect PHP with Sql Server 2005??? Thanks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/ Share on other sites More sharing options...
redarrow Posted November 8, 2011 Share Posted November 8, 2011 afther a good read on the net for you. works on 2005 aswell Apache 2.2.14 /PHP 5.2.12/MS-SQL 2008 integration * Download Apache 2.2.14 for Windows Installer package 2008 32 bit httpd DOT apache DOT org/download.cgi --> apache_2.2.14-win32-x86-no_ssl * follow the defaults when installing Apache * stop Apache 2.2 service * Download PHP 5.2.12 Windows Zip package for Windows 2008 32 bit; (VC6 Thread Safe version needed for PHP used as an Apache module). windows DOT php DOT net/download/ --> php-5.2.12-Win32-VC6-x86.zip - Extract the archive to C:\PHP - Verify the installation: C:\PHP>php -v - set the Environment Variable PHPRC=C:\PHP - Rename 'C:\PHP\php.ini-recommended' to 'C:\PHP\php.ini' - Edit C:\PHP\php,ini file: modify: extension_dir = "C:\PHP\ext" uncomment: extension=php_mssql.dll * Add the lines below to "C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf" PHPIniDir "C:/PHP/" LoadModule php5_module "C:/PHP/php5apache2_2.dll" AddHandler application/x-httpd-php .php * Add the lines below to "C:\Program Files\Apache Software Foundation\Apache2.2\conf\mime.types" application/x-httpd-php php application/x-httpd-php-source phps * Ensure that phpinfo.php file with the content: is in the folder C:\Program Files\Apache Software Foundation\Apache2.2\htdocs * Start Apache 2.2 service * Verification of Apache/PHP integration: http://localhost/phpinfo.php --> 'PHP Version 5.2.12' info shows up * Verification whether mssql' module is loaded: c:\php\php -m All works like a charm ... no additional steps needed. Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/#findComment-1286362 Share on other sites More sharing options...
requinix Posted November 8, 2011 Share Posted November 8, 2011 afther a good read on the net for you. Congratulations on reading everything except the bits where OP says he already has WAMP. All works like a charm ... no additional steps needed. Except for the additional steps needed to actually connect to SQL Server. Which, I believe, is the whole point of this thread. ankit.pandeyc012: Find the SQLSRV extension from Microsoft. They provide installation instructions. Once installed, try a couple of the examples in the PHP manual. Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/#findComment-1286366 Share on other sites More sharing options...
redarrow Posted November 8, 2011 Share Posted November 8, 2011 once the driver is added then that it alter Wamp directory with the modules Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/#findComment-1286369 Share on other sites More sharing options...
xyph Posted November 8, 2011 Share Posted November 8, 2011 WAMP makes this SO NICE AND EASY! Click on the little WAMP icon in the system tray. Go to the PHP submenu Go to the PHP extensions submenu Check either/both php_mssql, php_pdo_mssql The server will restart, with the extension enabled. Use the mssql functions found in the PHP manual http://php.net/manual/en/ref.mssql.php Man, I love WAMP Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/#findComment-1286409 Share on other sites More sharing options...
requinix Posted November 8, 2011 Share Posted November 8, 2011 Use the mssql functions found in the PHP manual http://php.net/manual/en/ref.mssql.php The mssql extension is dead. The PHP team suggests SQLSRV. This extension is not available anymore on Windows with PHP 5.3 or later. SQLSRV, an alternative driver for MS SQL is available from Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/#findComment-1286423 Share on other sites More sharing options...
xyph Posted November 9, 2011 Share Posted November 9, 2011 Well, I just got phpwned. Quote Link to comment https://forums.phpfreaks.com/topic/250679-how-to-connect-php-with-sql-server-2005/#findComment-1286456 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.