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
PHPMicrosoft SQL Server 2008Microsoft SQL Server 2005

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

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

ASKER
i have installed on same server and change port for php to 90 as it was conflicting with port
Dave Baldwin

"change port for php to 90" ??  What does that mean?  What did you install?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
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
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

thanks
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

Did you try the code examples in the link above?
itboyyz

ASKER
I tired the above example
not working stilll

dont know whats is the issue
Dave Baldwin

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
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
itboyyz

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.