I want to configure php to connect with sqlserver 2008 enterprise r2 .
i want to know each step by step details how to connect it.
i tried to install sql driver for php. but nothing working . really require your help as am new to php
thanks
PHPMicrosoft SQL Server 2008Microsoft SQL Server 2005
Last Comment
itboyyz
8/22/2022 - Mon
Dave Baldwin
Is PHP running in a web server on the same machine as the SQL Server or is it on a different machine? If it is on a different machine, then you need to install SQL Native Client because the SQLSRV driver needs it to operate properly. If it is on the same machine, it is already installed when you installed the SQL Server.
i have change listen 80 to listen 90 in php.ini file after sqlserver installation as locolhost for wamp was not opening. as searched thru net i found its coz of port and i had to chagne it to run php smoothly
Dave Baldwin
That doesn't make any sense. PHP itself does not listen to a port but the Apache web server does. Apache launches PHP when there is a request for a PHP file.
Which version of Windows are you running? Do you also have IIS or Skype installed? If you also have IIS installed, it will probably respond when you make a request to 'localhost' instead of Apache.
itboyyz
ASKER
iis is installed and wamp is running @localhost:90
but issue is how to connect sql server with php
i even tried to connect from another pc using sql native client
Create a file called 'phpinfo.php' in your web root with the contents below. Put it's url in your browser (http://localhost:90/phpinfo.php) and it should show a page containing a lot of info about your PHP installation. Look for 'sqlsrv' in that listing and tell me if you find it.
<?php// Show all information, defaults to INFO_ALLphpinfo();?>
The demo codes on this page http://us3.php.net/manual/en/function.sqlsrv-connect.php work fine if you have it set up correctly. You have to change some of the details to match your setup.