#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    165
    Rep Power
    18
    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.

    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
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0
    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.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    165
    Rep Power
    18
    Unfortunately I don't have any more insight for you. I hate Microsoft products. hadn't even personally owned a windows machine sense XP.
    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.

IMN logo majestic logo threadwatch logo seochat tools logo