Link to home
Create AccountLog in
Avatar of itboyyz
itboyyz

asked on

PHP SQLSERVER2008 CONFIGURATION

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
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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.

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.
Avatar of itboyyz
itboyyz

ASKER

i have installed on same server and change port for php to 90 as it was conflicting with port
"change port for php to 90" ??  What does that mean?  What did you install?
Avatar of itboyyz

ASKER

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
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.
Avatar of 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

thanks
Did you try the code examples in the link above?
Avatar of itboyyz

ASKER

I tired the above example
not working stilll

dont know whats is the issue
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_ALL
phpinfo();
?>

Open in new window

http://us3.php.net/manual/en/function.phpinfo.php
ASKER CERTIFIED SOLUTION
Avatar of itboyyz
itboyyz

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account