PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 8th, 2013, 12:10 PM
urisk23 urisk23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 urisk23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 48 sec
Reputation Power: 0
PHP-Extension - MS SQL Connection

I am pretty new to php, and I feel like I am missing something pretty fundamental. I am trying to connect to SQL Server. I have set up a wamp server on my desktop.
I have downloaded SQLSRV30.EXE and installed the files in C:\wamp\bin\php\php5.3.10\ext.

I have added the following line to the C:\wamp\bin\php\php5.3.10\php.ini file in the Extensions section:
extension=php_sqlsrv_53_ts.dll

and restarted the server.

I have seen other web sites that tell me I should see sqlsvr in the Registered PHP Streams (in the phpinfo page. I do not. And of course the sqlsvr calls don't work.

I receive errors like: Fatal error: Call to undefined function sqlsrv_connect()

Here is at least one piece I really don't understand. In my phpinfo page the "Loaded Configuration File " reads, "C:\wamp\bin\apache\Apache2.2.21\bin\php.ini" However, this doesn't seem to be the case. I have renamed that file, and I have modified that file in various ways, and it seems to have no affect. However, when I modify the C:\wamp\bin\php\php5.3.10\php.ini, and restart the server, it clearly does have affect. For instance, I tried the nts version and when I restarted the server, it failed pretty dramatically.

jic, I put the extension line in both php.ini files.

Anyway, I feel like I am missing something pretty fundamental. Any help would be appreciated.

Thanks

urisk

Reply With Quote
  #2  
Old January 9th, 2013, 11:00 PM
portcitysoftwar portcitysoftwar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 163 portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 18 m 54 sec
Reputation Power: 17
Just wondering if you installed the WAMP stack why not use the MySql server that came with the distribution that is pre-configured with php?

As far as using msSQL i would not use the sqlsrv extension instead use Php Data Objects or PDO. However either way you also need the sql server native client installed as well.

Quote:
Originally Posted by urisk23
I am pretty new to php, and I feel like I am missing something pretty fundamental. I am trying to connect to SQL Server. I have set up a wamp server on my desktop.
I have downloaded SQLSRV30.EXE and installed the files in C:\wamp\bin\php\php5.3.10\ext.

I have added the following line to the C:\wamp\bin\php\php5.3.10\php.ini file in the Extensions section:
extension=php_sqlsrv_53_ts.dll

and restarted the server.

I have seen other web sites that tell me I should see sqlsvr in the Registered PHP Streams (in the phpinfo page. I do not. And of course the sqlsvr calls don't work.

I receive errors like: Fatal error: Call to undefined function sqlsrv_connect()

Here is at least one piece I really don't understand. In my phpinfo page the "Loaded Configuration File " reads, "C:\wamp\bin\apache\Apache2.2.21\bin\php.ini" However, this doesn't seem to be the case. I have renamed that file, and I have modified that file in various ways, and it seems to have no affect. However, when I modify the C:\wamp\bin\php\php5.3.10\php.ini, and restart the server, it clearly does have affect. For instance, I tried the nts version and when I restarted the server, it failed pretty dramatically.

jic, I put the extension line in both php.ini files.

Anyway, I feel like I am missing something pretty fundamental. Any help would be appreciated.

Thanks

urisk

Reply With Quote
  #3  
Old January 10th, 2013, 02:58 PM
urisk23 urisk23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 urisk23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 48 sec
Reputation Power: 0
Quote:
Originally Posted by portcitysoftwar
Just wondering if you installed the WAMP stack why not use the MySql server that came with the distribution that is pre-configured with php?

As far as why. I already had the WAMP stack installed for my own purposes. Then my boss wanted me to look into web-enabling some of our software functionality. So I wanted to just start with my personal web server, on my workstation, just to keep things simple.

As far as using msSQL i would not use the sqlsrv extension instead use Php Data Objects or PDO. However either way you also need the sql server native client installed as well.


Regarding, using PDO, I probably will ultimately do this. This same SQL Server driver installs php_pdo_sqlsrv_53_ts.dll. I just wanted to establish a connection first.

I do have the SQL Server Native Client Installed. I use SQL Server and all of its tools in my day to day work.

Any insight would be helpful. Thanks.

Reply With Quote
  #4  
Old January 10th, 2013, 09:37 PM
portcitysoftwar portcitysoftwar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 163 portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level)portcitysoftwar User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 18 m 54 sec
Reputation Power: 17
Unfortunately I don't have any more insight for you. I hate Microsoft products. hadn't even personally owned a windows machine sense XP.
Quote:
Originally Posted by urisk23
Regarding, using PDO, I probably will ultimately do this. This same SQL Server driver installs php_pdo_sqlsrv_53_ts.dll. I just wanted to establish a connection first.

I do have the SQL Server Native Client Installed. I use SQL Server and all of its tools in my day to day work.

Any insight would be helpful. Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-Extension - MS SQL Connection

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap